Vue.js 如何在vue中创建/更新羽毛笔污点?

Vue.js 如何在vue中创建/更新羽毛笔污点?,vue.js,nuxt.js,quill,Vue.js,Nuxt.js,Quill,我看到了添加羽毛笔污点的文档,但作为一名通过使用vue学习js的新程序员,我不知道该把它放在哪里。我想更改类名以使用tailwind css类 我已经通过npm安装了“vue quill editor”,并让编辑器使用下面的代码 <template> <section class="container"> <no-ssr> <div v-quill:myQuillEditor="editorOption"

我看到了添加羽毛笔污点的文档,但作为一名通过使用vue学习js的新程序员,我不知道该把它放在哪里。我想更改类名以使用tailwind css类

我已经通过npm安装了“vue quill editor”,并让编辑器使用下面的代码

<template>
  <section class="container">
    <no-ssr>
      <div
        v-quill:myQuillEditor="editorOption"
        class="quill-editor"
        :content="content"
        @change="onEditorChange($event)"
      ></div>
    </no-ssr>
  </section>
</template>

<script>
/*
Emits the html content to parent using editor-content
a parent example <quill @editor-content="form.content = $event" />
*/
export default {
  data() {
    return {
      content: "<p>Start typing post...</p>",
      editorOption: {
        // some quill options
        modules: {
          toolbar: [
            ["bold", "italic", "underline", "strike"],
            ["blockquote", "code-block"],
            [{ list: "ordered" }, { list: "bullet" }],
            [{ indent: "-1" }, { indent: "+1" }], // outdent/indent

            [{ size: ["small", false, "large", "huge"] }], // custom dropdown
            [{ header: [1, 2, 3, 4, 5, 6, false] }],

            [{ color: [] }, { background: [] }], // dropdown with defaults from theme
            [{ font: [] }],
            [{ align: [] }],

            ["clean"]
          ]
        }
      }
    };
  },
  methods: {
    onEditorChange({ editor, html, text }) {
      this.content = html;
      this.$emit("editor-content", this.content);
    }
  }
};
</script>

<style scoped>
.quill-editor {
  min-height: 200px;
  max-height: 400px;
  overflow-y: auto;
}
</style>

/*
使用编辑器内容将html内容发送到父级
家长的例子
*/
导出默认值{
数据(){
返回{
内容:“开始键入post…

”, 编辑选项:{ //一些鹅毛笔选项 模块:{ 工具栏:[ [“粗体”、“斜体”、“下划线”、“删除”], [“块引号”,“代码块”], [{list:“ordered”},{list:“bullet”}], [{indent:“-1”},{indent:“+1”}],//outdent/indent [{size:[“小”,假,“大”,“大”]},//自定义下拉列表 [{header:[1,2,3,4,5,6,false]}, [{color:[]},{background:[]}],//主题的默认下拉列表 [{font:[]}], [{align:[]}], [“干净”] ] } } }; }, 方法:{ onEditorChange({编辑器,html,文本}){ this.content=html; this.$emit(“编辑器内容”,this.content); } } }; .羽毛笔编辑{ 最小高度:200px; 最大高度:400px; 溢出y:自动; }
您应该将其放在已安装的挂钩中,因为quill在DOM上运行