<html>
<body>
<div id="app" v-if="isShow">
aaaaaa
<button @click="btn1Click(12345,$event)">按钮1</button>
</div>
</body>
<script src="../js/vue.js"></script>
<script>
const app = new Vue({
el: '#app',
data: {
event: 'abcd',
isShow: true
},
methods: {
btn1Click(num, event) {
console.log(num, event)
this.isShow = false
}
}
})
</script>
</html>
v-if
最新推荐文章于 2024-07-19 10:04:44 发布