<script setup>
import { watchEffect } from 'vue';
const props = defineProps({
showDrawer: {
type: Boolean,
defult: false,
},
dateType: {
type: String,
},
});
watchEffect(()=>{
console.log('qqqqqq监听',props.showDrawer);
});
</script>
使用watchEffect 进行监听!!!!
这篇文章介绍了如何在Vue组件中使用`watchEffect`钩子函数来监听`showDrawer`属性的变化,以便在状态改变时执行相应的逻辑。
2305

被折叠的 条评论
为什么被折叠?



