vue v-show点击消失
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/vue.js" ></script>
</head>
<body>
<div id="app">
<button v-on:click="a=flase">点击消失</button>
<div style="width: 100px;height: 50px;background: yellowgreen;" v-show="a"></div>
</div>
<script>
new Vue({
el:"#app",
data:{
a:true
}
})
</script>
</body>
</html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="js/vue.js" ></script>
</head>
<body>
<div id="app">
<button v-on:click="a=flase">点击消失</button>
<div style="width: 100px;height: 50px;background: yellowgreen;" v-show="a"></div>
</div>
<script>
new Vue({
el:"#app",
data:{
a:true
}
})
</script>
</body>
</html>
声明:该文观点仅代表作者本人,牛骨文系教育信息发布平台,牛骨文仅提供信息存储空间服务。
- 上一篇: click与dblclick事件冲突解决方法
- 下一篇: vue.js的事件处理器v-on:click