watch了immediate参数,防止组件异步调用获取数据失败的问题
This commit is contained in:
parent
8852367837
commit
722ed9bece
|
@ -45,7 +45,15 @@ watch(fileList.value, (val) => {
|
||||||
console.log(val)
|
console.log(val)
|
||||||
emits('update:modelValue', val)
|
emits('update:modelValue', val)
|
||||||
})
|
})
|
||||||
|
watch(
|
||||||
|
() => props.modelValue,
|
||||||
|
value => {
|
||||||
|
fileList.value = value
|
||||||
|
emits('update:modelValue', val)
|
||||||
|
|
||||||
|
},
|
||||||
|
{immediate: true}
|
||||||
|
)
|
||||||
const uploadSuccess = (res) => {
|
const uploadSuccess = (res) => {
|
||||||
const {data} = res
|
const {data} = res
|
||||||
if (data.file) {
|
if (data.file) {
|
||||||
|
|
Loading…
Reference in New Issue