Vue3“直接”修改props
父组件
import { reactive } from 'vue';
//对话框数据
const show = reactive({
isshow: false,
});
//打开对话框
const show_dialog = () => {
show.isshow = true;
};
子组件
import { defineProps } from 'vue';
const props = defineProps({
show: {
type: Object,
},
});
const show_z = props.show;
const closeModal = () => {
console.log('关闭模态框');
show_z.isshow = false;
};