This commit is contained in:
闫晓茹 2023-04-27 17:00:01 +08:00
parent 0f78ff4272
commit 660a0d4c5b

View File

@ -9,10 +9,10 @@
:show-file-list="false"
:headers="headers"
style="display: none"
:data="filetype"
ref="upload"
v-if="this.type == 'url'"
>
</el-upload>
></el-upload>
<div class="editor" ref="editor" :style="styles"></div>
</div>
</template>
@ -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 {