|
@@ -61,8 +61,11 @@
|
|
|
</label>
|
|
|
</div>
|
|
|
<div class="sc-action-links">
|
|
|
- <select>
|
|
|
- <option>Qty: 1</option>
|
|
|
+ <select @change="onChangeQuantity($event, product)">
|
|
|
+ <option v-for=" i in 10"
|
|
|
+ :key="i"
|
|
|
+ :value="i"
|
|
|
+ :selected="checkQty(product.quantity, i)">Qty: {{ i }}</option>
|
|
|
</select>
|
|
|
|
|
|
<span>|</span>
|
|
@@ -199,6 +202,19 @@ export default {
|
|
|
|
|
|
computed: {
|
|
|
...mapGetters(['getCart', 'getCartTotalPrice', 'getCartLength'])
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onChangeQuantity (event, product) {
|
|
|
+ let qty = event.target.value * 1
|
|
|
+ this.$store.commit('changeQty', { product, qty })
|
|
|
+ },
|
|
|
+ checkQty (prodQty, qty) {
|
|
|
+ if (prodQty * 1 === qty * 1) {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</script>
|