From d3b630076af2b25603fba7c3adcf2c5313c3bd2e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=8A=93=E8=9B=99=E5=B8=88?= <770492966@qq.com>
Date: Fri, 5 Jan 2024 14:50:27 +0000
Subject: [PATCH] =?UTF-8?q?update=20=E5=AF=8C=E6=96=87=E6=9C=AC=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=EF=BC=8C=E4=BF=AE=E5=A4=8D=E4=B8=A4=E4=B8=AA=E7=BB=84?=
=?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=E5=9B=BE=E7=89=87=E4=BD=8D=E7=BD=AE?=
=?UTF-8?q?=E9=94=99=E4=B9=B1=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Signed-off-by: 抓蛙师 <770492966@qq.com>
---
src/components/Editor/index.vue | 38 ++++++++++++++++++++++-----------
1 file changed, 25 insertions(+), 13 deletions(-)
diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue
index d2467f1..be7f24a 100644
--- a/src/components/Editor/index.vue
+++ b/src/components/Editor/index.vue
@@ -2,7 +2,6 @@
+
@@ -64,18 +64,30 @@ const options = ref
({
debug: 'warn',
modules: {
// 工具栏配置
- toolbar: [
- ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线
- ['blockquote', 'code-block'], // 引用 代码块
- [{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表
- [{ indent: '-1' }, { indent: '+1' }], // 缩进
- [{ size: ['small', false, 'large', 'huge'] }], // 字体大小
- [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
- [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
- [{ align: [] }], // 对齐方式
- ['clean'], // 清除文本格式
- ['link', 'image', 'video'] // 链接、图片、视频
- ]
+ toolbar: {
+ container: [
+ ["bold", "italic", "underline", "strike"], // 加粗 斜体 下划线 删除线
+ ["blockquote", "code-block"], // 引用 代码块
+ [{ list: "ordered" }, { list: "bullet" }], // 有序、无序列表
+ [{ indent: "-1" }, { indent: "+1" }], // 缩进
+ [{ size: ["small", false, "large", "huge"] }], // 字体大小
+ [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题
+ [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色
+ [{ align: [] }], // 对齐方式
+ ["clean"], // 清除文本格式
+ ["link", "image", "video"] // 链接、图片、视频
+ ],
+ handlers: {
+ image: function (value: any) {
+ if (value) {
+ // 调用element图片上传
+ proxy?.$refs.uploadRef.click();
+ } else {
+ Quill.format("image", true);
+ }
+ },
+ },
+ }
},
placeholder: '请输入内容',
readOnly: props.readOnly