<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>
Logo

前往低代码交流专区

更多推荐