Merge pull request #6987 from dataease/pr@dev-v2@fix_img-upload

fix: 修复反复切换图片组件样式中缩略图没有变化问题
This commit is contained in:
王嘉豪 2023-12-04 15:30:45 +08:00 committed by GitHub
commit 2b7e430b53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,7 +5,7 @@ import { snapshotStoreWithOut } from '@/store/modules/data-visualization/snapsho
import { storeToRefs } from 'pinia'
import { ElIcon, ElMessage } from 'element-plus-secondary'
import { ref, onMounted, onBeforeUnmount } from 'vue'
import { ref, onMounted, onBeforeUnmount, watch } from 'vue'
import { beforeUploadCheck, uploadFileResult } from '@/api/staticResource'
import { imgUrlTrans } from '@/utils/imgUtils'
import eventBus from '@/utils/eventBus'
@ -76,6 +76,14 @@ const init = () => {
fileList.value = []
}
}
watch(
() => curComponent.value.propValue.url,
() => {
init()
}
)
onMounted(() => {
init()
eventBus.on('uploadImg', goFile)