methods: {
addToCart() {
this.$store.commit('addToCart', this.product);
this.$toasted.show('Product added to cart!', { type: 'success' });
},
placeOrder() {
axios.post('/api/orders', {
user_id: this.$store.state.user.id,
items: this.cart,
total_price: this.cartTotal,
}).then(() => {
this.$router.push('/orders');
this.$toasted.show('Order placed successfully!', { type: 'success' });
});
},
},
To make the UI more interactive, add animations using Vue's built-in transition component: