dbclick 改为dblclick即可:
实例代码:

<div id="app">
	<p>马云的年龄:{{age}}</p>
    <input type="button" @dblclick='reduce(10)' value="减少10岁">
    <input type="button" @dblclick='increase(10)' value="增加10岁">
</div>

<script src="vue.js"></script>

<script>
    let vm=new Vue({
        el:"#app",
        data:{
            age:50
        },
        methods: {
            increase:function(num){
                if(this === vm){
                    this.age += num;
                }
            },
            reduce:function(num){
                if(this === vm){
                    this.age -= num;
                }
            },
        },
    });
</script>

Logo

前往低代码交流专区

更多推荐