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