<template>
<div>
<quill-editor v-model:content="editorContent" contentType="html" />
</div>
</template>
<script>
import { ref } from 'vue';
import { QuillEditor } from '@vueup/vue-quill';
import '@vueup/vue-quill/dist/vue-quill.snow.css';
export default {
components: {
QuillEditor,
},
setup() {
const editorContent = ref('<p>初始富文本内容</p>');
return {
editorContent,
};
},
};
</script>
<style scoped>
/* 自定义样式 */
</style>
模板部分 (<template>):
quill-editor 组件,并通过 v-model:content 绑定编辑器的内容到 editorContent。contentType="html" 指定了内容类型为 HTML。脚本部分 (<script>):
ref 来创建一个可响应的变量 editorContent,用于存储富文本编辑器的内容。QuillEditor 组件,并在 components 中注册。snow 主题)。样式部分 (<style scoped>):
这个示例展示了如何在 Vue 3 中集成 Quill 富文本编辑器,并使用双向绑定来管理编辑器的内容。
上一篇:vue xlsx
下一篇:vue.set
Laravel PHP 深圳智简公司。版权所有©2023-2043 LaravelPHP 粤ICP备2021048745号-3
Laravel 中文站