fix: 组件初始化问题
This commit is contained in:
@ -226,14 +226,18 @@ function closeDialog() {
|
|||||||
reset()
|
reset()
|
||||||
loading = false
|
loading = false
|
||||||
}
|
}
|
||||||
|
async function init() {
|
||||||
watch(() => props.fileId, async () => {
|
if (!props.fileId) {
|
||||||
if (!props.fileId || avatarUrl)
|
avatarUrl = props.fileUrl
|
||||||
return
|
return
|
||||||
|
}
|
||||||
const res = await props.fileFunction(props.fileId)
|
const res = await props.fileFunction(props.fileId)
|
||||||
avatarUrl = res.url
|
avatarUrl = res.url
|
||||||
})
|
}
|
||||||
|
|
||||||
|
tryOnMounted(init)
|
||||||
|
|
||||||
|
watch(() => props.fileId, init)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
Reference in New Issue
Block a user