This commit is contained in:
bwbl 2026-01-13 14:17:14 +01:00
parent b7ba9a971b
commit d0fea51c69
2 changed files with 42 additions and 37 deletions

View File

@ -15,10 +15,13 @@
<div class="product-display"> <div class="product-display">
<div class="product-container"> <div class="product-container">
<div class="product-image"> <div class="product-image">
<img v-bind:src="image"> <img v-bind:src="image" />
</div> </div>
<div class="product-info"> <div class="product-info">
<h1>{{ product }}</h1> <h1>{{ product }}</h1>
<p v-if="inventory > 10">In Stock</p>
<p v-else>Out of Stock</p>
<p v-if="on_sale">On Sale</p>
</div> </div>
</div> </div>
</div> </div>
@ -29,7 +32,7 @@
<!-- Mount App --> <!-- Mount App -->
<script> <script>
const mountedApp = app.mount('#app') const mountedApp = app.mount("#app");
</script> </script>
</body> </body>
</html> </html>

12
main.js
View File

@ -1,8 +1,10 @@
const app = Vue.createApp({ const app = Vue.createApp({
data() { data() {
return { return {
product: 'Socks', product: "Socks",
image: './assets/images/socks_blue.jpg' image: "./assets/images/socks_blue.jpg",
} inventory: 100,
} on_sale: true,
}) };
},
});