L6 starting code
This commit is contained in:
parent
7f52372b6c
commit
12062da9d1
@ -27,7 +27,7 @@
|
|||||||
<li v-for="detail in details">{{ detail }}</li>
|
<li v-for="detail in details">{{ detail }}</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div v-for="variant in variants" :key="variant.id" @mouseover="updateImage(variant.image)">{{ variant.color }}</div>
|
<div v-for="variant in variants" :key="variant.id" @mouseover="updateImage(variant.image)">{{ variant.color }}</div>
|
||||||
<button class="button" v-on:click="addToCart">Add to Cart</button>
|
<button class="button">Add to Cart</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
8
main.js
8
main.js
@ -11,13 +11,5 @@ const app = Vue.createApp({
|
|||||||
{ id: 2235, color: 'blue', image: './assets/images/socks_blue.jpg' },
|
{ id: 2235, color: 'blue', image: './assets/images/socks_blue.jpg' },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
addToCart() {
|
|
||||||
this.cart += 1
|
|
||||||
},
|
|
||||||
updateImage(variantImage) {
|
|
||||||
this.image = variantImage
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user