// 解构
setup({ notifie }){
const localNotifie = ref({})
const [ set, { add, remove } ] = useSet(localNotifie.value.target)
// notifie 变化时, 无法触发监听
watch( () => notifie, () => {
console.log('watch')
localNotifie.value = cloneDeep(notifie)
})
return {
....
}
}
// 非结构
setup(props){
const localNotifie = ref({})
const [ set, { add, remove } ] = useSet(localNotifie.value.target)
// notifie 变化时, 触发监听
watch( () => props.notifie, () => {
console.log('watch')
localNotifie.value = cloneDeep(props.notifie)
})
return {
....
}
}