Pre Merge pull request !77 from 抓蛙师/ts
This commit is contained in:
commit
41639523e9
@ -12,6 +12,7 @@
|
|||||||
ref="uploadRef"
|
ref="uploadRef"
|
||||||
v-if="type === 'url'"
|
v-if="type === 'url'"
|
||||||
>
|
>
|
||||||
|
<i ref="uploadRef"></i>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
<div class="editor">
|
<div class="editor">
|
||||||
<quill-editor
|
<quill-editor
|
||||||
@ -47,7 +48,7 @@ const props = defineProps({
|
|||||||
type: propTypes.string.def('url')
|
type: propTypes.string.def('url')
|
||||||
});
|
});
|
||||||
|
|
||||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
|
||||||
const upload = reactive<UploadOption>({
|
const upload = reactive<UploadOption>({
|
||||||
headers: globalHeaders(),
|
headers: globalHeaders(),
|
||||||
@ -78,7 +79,7 @@ const options = ref({
|
|||||||
image: function (value: any) {
|
image: function (value: any) {
|
||||||
if (value) {
|
if (value) {
|
||||||
// 调用element图片上传
|
// 调用element图片上传
|
||||||
(document.querySelector(".editor-img-uploader>.el-upload") as HTMLDivElement)?.click();
|
proxy?.$refs.uploadRef.click();
|
||||||
} else {
|
} else {
|
||||||
Quill.format("image", true);
|
Quill.format("image", true);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user