修复两个富文本组件导致图片上传位置错乱问题

This commit is contained in:
抓蛙师 2024-01-05 22:35:13 +08:00
parent 14538ce399
commit b5fb6c70c7

View File

@ -12,6 +12,7 @@
style="display: none"
v-if="type === 'url'"
>
<i ref="uploadRef"></i>
</el-upload>
<div class="editor">
<quill-editor
@ -47,7 +48,7 @@ const props = defineProps({
type: propTypes.string.def('url')
});
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const upload = reactive<UploadOption>({
headers: globalHeaders(),
@ -78,7 +79,7 @@ const options = ref({
image: function (value: any) {
if (value) {
// element
(document.querySelector(".editor-img-uploader>.el-upload") as HTMLDivElement)?.click();
proxy?.$refs.uploadRef.click();
} else {
Quill.format("image", true);
}