<template>
<div class="editorContainer">
<el-form ref="ruleFormRef" style="max-width: 900px" :model="ruleForm" :rules="rules" label-width="auto"
class="demo-ruleForm" :size="formSize" status-icon>
<el-form-item label="标题" prop="name">
<el-input v-model="ruleForm.name" />
</el-form-item>
<div class="editorContent">
<div class="leftcontentContainer">内容</div>
<div class="editor">
<quill-editor content-type='html' v-model:content='articleModel.content' :options='options'
@blur='editorBlur($event)' />
<!-- <quill-editor content-type='html' :content='content' :options='options'
@blur='editorBlur($event)' /> -->
<!-- <quill-editor content-type='html' :content='content' :options='options'
@blur='editorBlur($event)' /> -->
</div>
</div>
<div class="mb-4">
<el-button round>保存</el-button>
<el-button type="primary" round>提交</el-button>
</div>
</el-form>
</div>
</template>
<script setup>
// import { ref } from 'vue';
// let content = ref("<p> 初始内容。。。</p>");
let options = {
modules: {
toolbar: [
['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
[{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
[{ align: [] }], // 对齐方式
[{ size: ['small', false, 'large', 'huge'] }], // 字体大小
[{ font: [] }], // 字体种类
[{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
[{ direction: 'ltl' }], // 文本方向
[{ direction: 'rtl' }], // 文本方向
[{ indent: '-1' }, { indent: '+1' }], // 缩进
[{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
[{ script: 'sub' }, { script: 'super' }], // 上标/下标
['blockquote', 'code-block'], // 引用 代码块
['clean'], // 清除文本格式
['link', 'image', 'video'], // 链接、图片、视频
],
},
};
</script>
<script>
export default {
data() {
return {
ruleForm: [{
name: ''
}],
articleModel: [{
content: ''
}]
}
}
}
</script>
<style lang="less">
.demo-ruleForm {
margin: 0 auto;
}
.div span {
text-align: left;
}
.editorContent {
display: flex;
}
.editorContainer {
margin-top: 15px;
}
.leftcontentContainer {
margin-right: 9px;
}
.editor {
width: 857px;
margin-bottom: 60px;
}
.ql-container {
height: 400px;
}
.demo-ruleForm {
width: 1000px;
}
.mb-4 button {
margin: 0 0 0 760px;
}
</style>