From 584c3fb466aeb3ebac8e3a2ea5ae95621573fec3 Mon Sep 17 00:00:00 2001 From: dhb52 Date: Thu, 6 Apr 2023 18:32:11 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=BE=AE=E4=BF=A1=E8=8D=89=E7=A8=BF?= =?UTF-8?q?=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + .../mp/components/wx-editor/WxEditor.vue | 229 +++++ src/views/mp/components/wx-editor/options.js | 16 + src/views/mp/draft/index.vue | 834 +++++++++++++++++- src/views/mp/freePublish/index.vue | 4 +- 5 files changed, 1081 insertions(+), 3 deletions(-) create mode 100644 src/views/mp/components/wx-editor/WxEditor.vue create mode 100644 src/views/mp/components/wx-editor/options.js diff --git a/package.json b/package.json index 8fd1a0eb6..2e39bb16e 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,7 @@ "@form-create/element-ui": "^3.1.17", "@iconify/iconify": "^3.1.0", "@videojs-player/vue": "^1.0.0", + "@vueup/vue-quill": "^1.1.1", "@vueuse/core": "^9.13.0", "@wangeditor/editor": "^5.1.23", "@wangeditor/editor-for-vue": "^5.1.10", diff --git a/src/views/mp/components/wx-editor/WxEditor.vue b/src/views/mp/components/wx-editor/WxEditor.vue new file mode 100644 index 000000000..e5082d9c2 --- /dev/null +++ b/src/views/mp/components/wx-editor/WxEditor.vue @@ -0,0 +1,229 @@ + + + + + diff --git a/src/views/mp/components/wx-editor/options.js b/src/views/mp/components/wx-editor/options.js new file mode 100644 index 000000000..c44888855 --- /dev/null +++ b/src/views/mp/components/wx-editor/options.js @@ -0,0 +1,16 @@ +export const toolbarOptions = [ + ['bold', 'italic', 'underline', 'strike'], // 加粗 斜体 下划线 删除线 + ['blockquote', 'code-block'], // 引用 代码块 + [{ header: 1 }, { header: 2 }], // 1、2 级标题 + [{ list: 'ordered' }, { list: 'bullet' }], // 有序、无序列表 + [{ script: 'sub' }, { script: 'super' }], // 上标/下标 + [{ indent: '-1' }, { indent: '+1' }], // 缩进 + // [{'direction': 'rtl'}], // 文本方向 + [{ size: ['small', false, 'large', 'huge'] }], // 字体大小 + [{ header: [1, 2, 3, 4, 5, 6, false] }], // 标题 + [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 + [{ font: [] }], // 字体种类 + [{ align: [] }], // 对齐方式 + ['clean'], // 清除文本格式 + ['link', 'image', 'video'] // 链接、图片、视频 +] diff --git a/src/views/mp/draft/index.vue b/src/views/mp/draft/index.vue index 497f72ec1..c025e27a4 100644 --- a/src/views/mp/draft/index.vue +++ b/src/views/mp/draft/index.vue @@ -1,3 +1,835 @@ + + + + diff --git a/src/views/mp/freePublish/index.vue b/src/views/mp/freePublish/index.vue index 565d2da5e..338b80c51 100644 --- a/src/views/mp/freePublish/index.vue +++ b/src/views/mp/freePublish/index.vue @@ -21,8 +21,8 @@ - 搜索 - 重置 + 搜索 + 重置 -- Gitee