實(shí)現(xiàn)效果
?文章來源地址http://www.zghlxwxcb.cn/news/detail-603108.html
1.安裝插件 npm install vue-quill-editor --save
2.安裝成功后在package.json中查看
3.在main.js中全局引入插件
// 富文本編輯器
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)
4.頁面實(shí)現(xiàn)
<template>
<div class="body">
<h2>富文本編輯器</h2>
<quill-editor ref="text" v-model="content" class="editor" :options="editorOption"/>
<el-button class="button" @click="onEditor">提交</el-button>
</div>
</template>
<script>
export default {
data() {
return {
content: "",
editorOption: {},
};
},
methods: {
onEditor() {
console.log("富文本內(nèi)容=",this.$refs.text.value);
},
},
};
</script>
<style lang="less" scoped>
.body {
height: 700px;
.editor {
height: 500px;
}
.button {
margin-left: 50%;
margin-top: 50px;
}
}
</style>
感謝老哥:?ElementUI生成富文本編輯器https://blog.csdn.net/keplerm/article/details/123379511?spm=1001.2101.3001.6650.9&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-9-123379511-blog-125430395.235%5Ev36%5Epc_relevant_anti_vip_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-9-123379511-blog-125430395.235%5Ev36%5Epc_relevant_anti_vip_base&utm_relevant_index=18https://blog.csdn.net/keplerm/article/details/123379511?spm=1001.2101.3001.6650.9&utm_medium=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-9-123379511-blog-125430395.235%5Ev36%5Epc_relevant_anti_vip_base&depth_1-utm_source=distribute.pc_relevant.none-task-blog-2%7Edefault%7EBlogCommendFromBaidu%7ERate-9-123379511-blog-125430395.235%5Ev36%5Epc_relevant_anti_vip_base&utm_relevant_index=18文章來源:http://www.zghlxwxcb.cn/news/detail-603108.html
?
到了這里,關(guān)于簡(jiǎn)版的富文本編輯器、VUE+ElementUI 富文本編輯器 element ui富文本編輯器的使用(quill-editor) 不好用你來打我!全網(wǎng)醉簡(jiǎn)單!要復(fù)雜的別來!的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!