File tree 2 files changed +19
-12
lines changed
2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 4
4
< meta charset ="UTF-8 " />
5
5
< meta name ="viewport " content ="width=device-width,initial-scale=1 " />
6
6
< title > Quill Demo (react)</ title >
7
- < link id ="src-code " data ="https://github.com/benwinding/quill-html-edit-button/blob/master/demos/vue " > </ link >
7
+ < link id ="src-code " data ="https://github.com/benwinding/quill-html-edit-button/blob/master/demos/react " > </ link >
8
8
< script src ="./header-text.js " > </ script >
9
9
10
10
<!-- Theme included stylesheets -->
Original file line number Diff line number Diff line change 1
1
import React , { useState } from 'react' ;
2
2
3
- // import htmlEditButton from "../../../src/quill.htmlEditButton";
3
+ import htmlEditButton from "../../../src/quill.htmlEditButton" ;
4
4
// import htmlEditButton from "quill-html-edit-button";
5
5
// ^ In production use this
6
- import ReactQuill from 'react-quill' ;
6
+ import ReactQuill , { Quill } from 'react-quill' ;
7
7
import 'react-quill/dist/quill.snow.css' ;
8
8
9
- // const modules = {
10
- // ['name']: 'htmlEditButton',
11
- // ['module']: htmlEditButton,
12
- // ['options']: {
13
- // debug: true
14
- // },
15
- // };
9
+ import Toolbar from "quill/modules/toolbar" ;
10
+ import Snow from "quill/themes/snow" ;
11
+
12
+ Quill . register ( {
13
+ 'modules/toolbar' : Toolbar ,
14
+ 'themes/snow' : Snow ,
15
+ "modules/htmlEditButton" : htmlEditButton
16
+ } )
17
+
18
+ const modules = {
19
+ htmlEditButton : {
20
+ debug : true ,
21
+ }
22
+ } ;
16
23
17
24
export function MyApp ( ) {
18
- const [ value , setValue ] = useState ( '' ) ;
25
+ const [ value , setValue ] = useState ( 'Here is some text! ' ) ;
19
26
20
27
return < ReactQuill theme = "snow" value = { value } onChange = { setValue }
21
- // modules={modules}
28
+ modules = { modules }
22
29
/> ;
23
30
}
You can’t perform that action at this time.
0 commit comments