标签:script meta 显示 -- org type on() var 隐藏
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>v-if、v-else、v-show</title>
<script src="../js/vue.js"></script>
<!--copy from http://vuejs.org.cn/guide/-->
</head>
<body>
<div id="app">
<p v-if="willShow">显示</p>
<p v-else>隐藏</p>
<button @click="fn()">改变</button>
</div>
<script>
var vm=new Vue({
el:"#app",
data:{
willShow:true
},
methods:{
fn:function(){
if(this.willShow==true){
this.willShow=false;
}else{
this.willShow=true
}
}
}
});
</script>
</body>
</html>
标签:script meta 显示 -- org type on() var 隐藏
原文地址:https://www.cnblogs.com/JamyWong/p/10024756.html