Quiz Entry - updated: 2026.06.20
How can Vue.js simplify a shopping cart or order form?
You model the cart as a reactive array of item objects and let Vue re-render the list whenever that array changes.
Vue.createApp({
data() {
return {
items: [
{ anzahl: 0, name: 'Pizza Margherita', preis: 7.50 },
{ anzahl: 0, name: 'Pizza 4 Stagione', preis: 9.50 },
{ anzahl: 0, name: 'Pizza Fantasia', preis: 11 }
]
}
},
methods: {
/* calculate total */
sum: function() { }
}
}).mount('#liste');
Instead of manually updating DOM elements, just modify the items array.