优化一处代码
This commit is contained in:
parent
a2e2a05689
commit
5ed2f6412d
|
@ -42,6 +42,7 @@ export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
utils: this.$utils,
|
utils: this.$utils,
|
||||||
|
loadedCartCount: false,
|
||||||
position: { x: 300, y: 1000 },
|
position: { x: 300, y: 1000 },
|
||||||
currentId: 0,
|
currentId: 0,
|
||||||
newId: 0,
|
newId: 0,
|
||||||
|
@ -88,8 +89,9 @@ export default {
|
||||||
this.loadCate();
|
this.loadCate();
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
if (this.isLogin) {
|
if (this.isLogin && !this.loadedCartCount) {
|
||||||
this.$store.dispatch("cart/updateCount");
|
this.$store.dispatch("cart/updateCount");
|
||||||
|
this.loadedCartCount = true;
|
||||||
}
|
}
|
||||||
this.newId = this.currentId = this.currentCateId;
|
this.newId = this.currentId = this.currentCateId;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue