【优化】处理抽屉中 绘画中的图片不能展示加载状态
This commit is contained in:
parent
bbf7956f6d
commit
11ec263a64
@ -112,7 +112,6 @@ watch(show, async (newValue, oldValue) => {
|
|||||||
// watch id
|
// watch id
|
||||||
const { id } = toRefs(props)
|
const { id } = toRefs(props)
|
||||||
watch(id, async (newVal, oldVal) => {
|
watch(id, async (newVal, oldVal) => {
|
||||||
console.log('newVal', newVal)
|
|
||||||
if (newVal) {
|
if (newVal) {
|
||||||
await getImageDetail(newVal)
|
await getImageDetail(newVal)
|
||||||
}
|
}
|
||||||
|
@ -41,12 +41,8 @@ const handlerBtnClick = async (type, imageDetail: ImageDetailVO) => {
|
|||||||
emits('onBtnClick', type, imageDetail)
|
emits('onBtnClick', type, imageDetail)
|
||||||
}
|
}
|
||||||
|
|
||||||
// emits
|
const handlerLoading = async (status: string) => {
|
||||||
const emits = defineEmits(['onBtnClick'])
|
if (status === 'in_progress') {
|
||||||
|
|
||||||
//
|
|
||||||
onMounted(async () => {
|
|
||||||
if (props.imageDetail.status === 'in_progress') {
|
|
||||||
cardImageLoadingInstance.value = ElLoading.service({
|
cardImageLoadingInstance.value = ElLoading.service({
|
||||||
target: cardImageRef.value,
|
target: cardImageRef.value,
|
||||||
text: '生成中...'
|
text: '生成中...'
|
||||||
@ -57,6 +53,19 @@ onMounted(async () => {
|
|||||||
cardImageLoadingInstance.value = null;
|
cardImageLoadingInstance.value = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
// watch
|
||||||
|
const { imageDetail } = toRefs(props)
|
||||||
|
watch(imageDetail, async (newVal, oldVal) => {
|
||||||
|
await handlerLoading(newVal.status as string)
|
||||||
|
})
|
||||||
|
|
||||||
|
// emits
|
||||||
|
const emits = defineEmits(['onBtnClick'])
|
||||||
|
|
||||||
|
//
|
||||||
|
onMounted(async () => {
|
||||||
|
await handlerLoading(props.imageDetail.status as string)
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user