8000 你好,你的代码cartcontrol.vue组件, 点击 加号 会触发两次,怎么解决? · Issue #3 · zsqosos/eapp · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
你好,你的代码cartcontrol.vue组件, 点击 加号 会触发两次,怎么解决? #3
Open
@xiaobaicai128

Description

@xiaobaicai128

methods: {
addCart(event) {
// if (!event._constructed) {
// return;
// }
if (!this.food.count) {
this.$set(this.food, 'count', 1);
} else {
this.food.count++;
}
this.$store.commit({
type: 'initBallEle',
el: event.target
})
this.$root.$emit('add_cart');
},
decreaseCart(event) {
// if (!event._constructed) {
// return;
// }
if (this.food.count) {
this.food.count--;
}
}
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0