vue学习笔记: mounted简单使用
<input type="button" style="width: 100px; height: 100px" @click="B"><script>var app = new Vue({el:'#app',data:{checked:true,mydata:{name:'hello', pwd:'123'}},methods:{.
·
<input type="button" style="width: 100px; height: 100px" @click="B">
<script>
var app = new Vue({
el:'#app',
data:{
checked:true,
mydata:{name:'hello', pwd:'123'}
},
methods:{
A:function (){
console.log("A: ");
console.log(this);
this.B();
},
B:function (){
console.log("B: ");
console.log(this);
this.C();
alert(this.checked)
if(this.checked == false)
this.D();
},
C:function (){
console.log("C: ");
console.log(this);
this.checked = false;
},
D:function (){
console.log("D: ");
console.log(this);
}
},
mounted: function (){
console.log("mounted: ");
console.log(this);
this.A();
}
});
</script>
更多推荐
已为社区贡献1条内容
所有评论(0)