From dc9f3ee72256c7ca1413d6f5489e4cb5d4a7eb7b Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 15 Oct 2024 16:18:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7quill=E5=88=B0=E6=9C=80?= =?UTF-8?q?=E6=96=B0=E7=89=88=E6=9C=AC2.0.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-ui/package.json | 2 +- ruoyi-ui/src/components/Editor/index.vue | 4 ++-- ruoyi-ui/vue.config.js | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ruoyi-ui/package.json b/ruoyi-ui/package.json index 7e438cc2f..81904c39d 100644 --- a/ruoyi-ui/package.json +++ b/ruoyi-ui/package.json @@ -49,7 +49,7 @@ "js-cookie": "3.0.1", "jsencrypt": "3.0.0-rc.1", "nprogress": "0.2.0", - "quill": "1.3.7", + "quill": "2.0.2", "screenfull": "5.0.2", "sortablejs": "1.10.2", "vue": "2.6.12", diff --git a/ruoyi-ui/src/components/Editor/index.vue b/ruoyi-ui/src/components/Editor/index.vue index 8981d7635..9323e5382 100644 --- a/ruoyi-ui/src/components/Editor/index.vue +++ b/ruoyi-ui/src/components/Editor/index.vue @@ -108,7 +108,7 @@ export default { if (val !== this.currentValue) { this.currentValue = val === null ? "" : val; if (this.Quill) { - this.Quill.pasteHTML(this.currentValue); + this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue); } } }, @@ -136,7 +136,7 @@ export default { } }); } - this.Quill.pasteHTML(this.currentValue); + this.Quill.clipboard.dangerouslyPasteHTML(this.currentValue); this.Quill.on("text-change", (delta, oldDelta, source) => { const html = this.$refs.editor.children[0].innerHTML; const text = this.Quill.getText(); diff --git a/ruoyi-ui/vue.config.js b/ruoyi-ui/vue.config.js index 1766cf874..fa67f51b1 100644 --- a/ruoyi-ui/vue.config.js +++ b/ruoyi-ui/vue.config.js @@ -27,6 +27,7 @@ module.exports = { lintOnSave: process.env.NODE_ENV === 'development', // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 productionSourceMap: false, + transpileDependencies: ['quill'], // webpack-dev-server 相关配置 devServer: { host: '0.0.0.0',