Vue-quill Official website: https://www.npmjs.com/package/vue-quill-editor
Quill official Website: https://quilljs.com/docs/quickstart/
Basic usage is not introduced here, here are the following special usage:
How to add custom blots and Custom toolbar controls
<Template><Quilleditorref= "Editor"V-model= "Content": Options= "Editoroption"> <DivID= "Toolbar"Slots= "Toolbar"> <Selectclass= "Ql-size"> <optionvalue= "small">Small</option> <optionselected>Conventional</option> <optionvalue= "Large">Big</option> <optionvalue= "huge">Large</option> </Select> <Buttontype= "button"class= "Ql-bold"></Button> <Buttontype= "button"class= "Ql-italic"></Button> <Buttontype= "button"class= "Ql-underline"></Button> <Selectclass= "Ql-color"></Select> <Buttontype= "button"class= "Ql-image"></Button> <Buttontype= "button"class= "Ql-list"value= "Ordered"></Button> <Buttontype= "button"class= "Ql-list"value= "Bullet"></Button> <Selectclass= "Ql-align"></Select> <!--Custom Controls - <Button@click= "Addmyblot">Custom Buttons</Button> </Div></Quilleditor></Template><Script>Import {Quill} from'Vue-quill-editor';//Get inlineConst Embed=Quill.import ('blots/embed'); class Myblot extends Embed {static Blotname= 'Myblot'; Static TagName= 'Myblot'; Static Create (value) {const node=super.create (value); Node.innerhtml=value; Node.setattribute ('ID', value); returnnode; }}//RegisterQuill.register (myblot); Exportdefault{data () {return{content:"', Editoroption: {placeholder:'Please enter text ...', Modules: {toolbar:'#toolbar',},},} }, method: {//Vue-quill's small bug //Although it is a two-way binding, it cannot be changed directly to Content,ql-editor's innerHTML, otherwise the value of blot will become truesetcontent (InnerHTML) {setTimeout ()={Const Quill= This. $refs ['Editor'].quill; Quill.container.querySelector ('. Ql-editor'). InnerHTML=InnerHTML}) }, Addmyblot () {Const Quill= This. $refs ['Editor'].quill; Quill.insertembed (Index,'Myblot', 'Balabala ... '); } }}</Script>
The use of rich text box Vue-quill-editor