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

View File

@@ -386,11 +386,13 @@
// 基础 // 基础
import { import {
ref, ref,
inject,
reactive, reactive,
onMounted, onMounted,
computed, computed,
getCurrentInstance getCurrentInstance
} from 'vue' } from 'vue'
const { $api, navTo, throttle, config } = inject('globalFunction');
const props = defineProps({ const props = defineProps({
content: { content: {
type: String, type: String,
@@ -538,24 +540,23 @@
success: (res) => { success: (res) => {
// 本地路径 // 本地路径
let localPath = res.tempFilePaths[0] 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> </script>