From 660a0d4c5b0ea11fbee2fb0ef10f8cc6085368cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Thu, 27 Apr 2023 17:00:01 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Editor/index.vue | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/src/components/Editor/index.vue b/src/components/Editor/index.vue index 1e5db86..616fa47 100644 --- a/src/components/Editor/index.vue +++ b/src/components/Editor/index.vue @@ -9,10 +9,10 @@ :show-file-list="false" :headers="headers" style="display: none" + :data="filetype" ref="upload" v-if="this.type == 'url'" - > - + >
@@ -57,10 +57,18 @@ export default { type: String, default: "url", }, + url: { + type: String, + default: "/common/richTextPictureUrl", + }, + // filetypes: { + // type: String, + // default: "", + // }, }, data() { return { - uploadUrl: process.env.VUE_APP_BASE_API + "/common/richTextPictureUrl", // 上传的图片服务器地址 + uploadUrl: process.env.VUE_APP_BASE_API, // 上传的图片服务器地址 headers: { Authorization: "Bearer " + getToken(), }, @@ -82,14 +90,22 @@ export default { [{ color: [] }, { background: [] }], // 字体颜色、字体背景颜色 [{ align: [] }], // 对齐方式 ["clean"], // 清除文本格式 - ["link", "image", "video"], // 链接、图片、视频 + ["link", "image"], // 链接、图片、视频 ], }, placeholder: "请输入内容", readOnly: this.readOnly, }, + filetype: { + type: "", + }, }; }, + created() { + this.uploadUrl = process.env.VUE_APP_BASE_API + this.url; + // console.log(this.url) + // this.filetype.type = this.filetypes; + }, computed: { styles() { let style = {}; @@ -181,9 +197,8 @@ export default { "image", process.env.VUE_APP_BASE_API + res.fileName ); - + console.log(res); this.$emit("imgs", res.fileName); - // 调整光标到最后 quill.setSelection(length + 1); } else {