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" :show-file-list="false"
:headers="headers" :headers="headers"
style="display: none" style="display: none"
:data="filetype"
ref="upload" ref="upload"
v-if="this.type == 'url'" v-if="this.type == 'url'"
> ></el-upload>
</el-upload>
<div class="editor" ref="editor" :style="styles"></div> <div class="editor" ref="editor" :style="styles"></div>
</div> </div>
</template> </template>
@ -57,10 +57,18 @@ export default {
type: String, type: String,
default: "url", default: "url",
}, },
url: {
type: String,
default: "/common/richTextPictureUrl",
},
// filetypes: {
// type: String,
// default: "",
// },
}, },
data() { data() {
return { return {
uploadUrl: process.env.VUE_APP_BASE_API + "/common/richTextPictureUrl", // uploadUrl: process.env.VUE_APP_BASE_API, //
headers: { headers: {
Authorization: "Bearer " + getToken(), Authorization: "Bearer " + getToken(),
}, },
@ -82,14 +90,22 @@ export default {
[{ color: [] }, { background: [] }], // [{ color: [] }, { background: [] }], //
[{ align: [] }], // [{ align: [] }], //
["clean"], // ["clean"], //
["link", "image", "video"], // ["link", "image"], //
], ],
}, },
placeholder: "请输入内容", placeholder: "请输入内容",
readOnly: this.readOnly, 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: { computed: {
styles() { styles() {
let style = {}; let style = {};
@ -181,9 +197,8 @@ export default {
"image", "image",
process.env.VUE_APP_BASE_API + res.fileName process.env.VUE_APP_BASE_API + res.fileName
); );
console.log(res);
this.$emit("imgs", res.fileName); this.$emit("imgs", res.fileName);
// //
quill.setSelection(length + 1); quill.setSelection(length + 1);
} else { } else {