This commit is contained in:
2026-03-04 15:44:28 +08:00
parent 97d8c987d1
commit ab01115daa

View File

@@ -386,11 +386,13 @@
// 基础
import {
ref,
inject,
reactive,
onMounted,
computed,
getCurrentInstance
} from 'vue'
const { $api, navTo, throttle, config } = inject('globalFunction');
const props = defineProps({
content: {
type: String,
@@ -538,24 +540,23 @@
success: (res) => {
// 本地路径
let localPath = res.tempFilePaths[0]
// 在此可以自定义图片上传
// 在此可以自定义图片上传
// 在此可以自定义图片上传
$api.uploadFile(localPath, true).then((resData) => {
resData = JSON.parse(resData);
// 插入图片
editorCtx.value.insertImage({
src: resData.msg,
alt: '图像',
success: function() {
console.log('insert image success')
}
})
});
// 在此可以自定义图片上传
// 在此可以自定义图片上传
// 在此可以自定义图片上传
// ...
let onlinePath = localPath
// 插入图片
editorCtx.value.insertImage({
src: onlinePath,
alt: '图像',
success: function() {
console.log('insert image success')
}
})
}
})
}
</script>