vue3父子组件传参能在页面看见数据不能在script标签中输出
解决办法
const props = defineProps(['fileList'])
watch(
() => props.fileList,
() => {
console.log(props.fileList)
})
如果还不能输出,看我放大招了
const props = defineProps(['fileList'])
watch(
() => props.fileList,
() => {
console.log(props.fileList)
},{ deep: true, immediate: true })