Skip to content

Commit

Permalink
update to 1.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
alex.xu committed Dec 4, 2023
1 parent 46cc9d8 commit 0a4650f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
5 changes: 5 additions & 0 deletions src/components/inputBox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@
// 提交数据
emit('submit', {title: data.title, price: data.price, num: (data.num == -1 ? 1 : data.num), priceTxt: data.price.toFixed(2)}, props.index);
// 直接清空
good.value.title = '';
good.value.price = 0;
good.value.num = -1,
good.value.priceTxt = '';
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/cart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const useCartStore = defineStore('cart', () => {
}

// 如果存在,则直接加数量,前面加判定防止出现意外值
if (ind >= 0 && state.datalist[ind]) state.datalist[ind].num += data.num;
if (ind >= 0 && state.datalist[ind]) state.datalist[ind].num += data.num;

}

Expand Down
10 changes: 1 addition & 9 deletions src/views/HomeView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
</footer>

<!-- 弹框 -->
<input-box v-model:good="goodItem" v-model:index="index" @close="close" @submit="submit" v-show="combox"></input-box>
<input-box v-model:good="goodItem" :index="index" @close="close" @submit="submit" v-show="combox"></input-box>

<!-- 遮罩层 -->
<div class="mask" :style="{height: bgHeight}" @click="close" v-show="mask"></div>
Expand All @@ -54,7 +54,6 @@
import { vuepop, vuemsg } from 'vue3-popup';
import 'vue3-popup/lib/style.css';
import { watch } from 'vue';
// 加载store
const cartStore = useCartStore();
Expand Down Expand Up @@ -144,9 +143,6 @@ import { watch } from 'vue';
index === '' ? cartStore.add(good) : cartStore.update(good, index);
// 重置数据
goodReset();
// 关闭弹窗
actBox(0);
Expand Down Expand Up @@ -181,10 +177,6 @@ import { watch } from 'vue';
}
watch(index, (newX) => {
console.log(newX);
}, {deep: true})
</script>


Expand Down

0 comments on commit 0a4650f

Please sign in to comment.