export default defineComponent({
props: {
isOpen: Boolean,
},
emits: {
"close-modal": null,
},
setup(props, context) {
watch(
() => props.isOpen, // reactive同理
(newProps) => {
console.log(newProps);//查看新值
}
);
const closeModal = () => {
context.emit("close-modal");
};
return {
closeModal,
};
},
});
标签:newProps,isOpen,closeModal,Vue3.0,modal,props,close,监听 From: https://www.cnblogs.com/suihung/p/16889343.html