<father>
<child :params.sync="fatherParams" />
</father>
//子组件接收父组件参数
const props = defineProps({
params: any
})
const childParams = ref<any>(null)
watch(() => props.params, () => {
//此处不能用深复制,深拷贝会导致页面崩溃
//childParams.value = JSON.parse(JSON.stringify(props.params))
childParams.value = props.params
})
vue2 sync修饰符导致页面崩溃
于 2023-04-18 15:54:32 首次发布