vue的富文本插件
npm安装插件
npm i vue-quill-editor -S
main.js全局引入
// 配置富文本 vue-quill-editor
import VueQuillEditor from 'vue-quill-editor'
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
Vue.use(VueQuillEditor)
单页面应用
<div>
<quill-editor style="color:#333" v-model="txt" ref="richAnalysis" :options="options"></quill-editor>
<el-button type="primary" @click="saveHtml()" class="email-save-button">发送</el-button>
</div>
//js
export default {
data(){
let txt = `<p>aaa</p>`
return{
txt:txt,
options: {
placeholder: "请输入内容"
},
}
},
methods:{
saveHtml: function() {
console.log(this.txt);
},
}
}