L6
This commit is contained in:
parent
f91df3ac12
commit
bb65d2a275
88
index.html
88
index.html
@ -1,44 +1,56 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="en">
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="UTF-8" />
|
<meta charset="UTF-8" />
|
||||||
<title>Vue Mastery</title>
|
<title>Vue Mastery</title>
|
||||||
<!-- Import Styles -->
|
<!-- Import Styles -->
|
||||||
<link rel="stylesheet" href="./assets/styles.css" />
|
<link rel="stylesheet" href="./assets/styles.css" />
|
||||||
<!-- Import Vue.js -->
|
<!-- Import Vue.js -->
|
||||||
<script src="https://unpkg.com/vue@3.0.11/dist/vue.global.js"></script>
|
<script src="https://unpkg.com/vue@3.0.11/dist/vue.global.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div class="nav-bar"></div>
|
<div class="nav-bar"></div>
|
||||||
|
|
||||||
<div class="cart">Cart({{ cart }})</div>
|
<div class="cart">Cart({{ cart }})</div>
|
||||||
|
|
||||||
<div class="product-display">
|
|
||||||
<div class="product-container">
|
|
||||||
<div class="product-image">
|
|
||||||
<img v-bind:src="image">
|
|
||||||
</div>
|
|
||||||
<div class="product-info">
|
|
||||||
<h1>{{ product }}</h1>
|
|
||||||
<p v-if="inStock">In Stock</p>
|
|
||||||
<p v-else>Out of Stock</p>
|
|
||||||
<ul>
|
|
||||||
<li v-for="detail in details">{{ detail }}</li>
|
|
||||||
</ul>
|
|
||||||
<div v-for="variant in variants" :key="variant.id">{{ variant.color }}</div>
|
|
||||||
<button class="button">Add to Cart</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Import App -->
|
<div class="product-display">
|
||||||
<script src="./main.js"></script>
|
<div class="product-container">
|
||||||
|
<div class="product-image">
|
||||||
|
<img v-bind:src="image" />
|
||||||
|
</div>
|
||||||
|
<div class="product-info">
|
||||||
|
<h1>{{ product }}</h1>
|
||||||
|
<p v-if="inStock">In Stock</p>
|
||||||
|
<p v-else>Out of Stock</p>
|
||||||
|
<ul>
|
||||||
|
<li v-for="detail in details">{{ detail }}</li>
|
||||||
|
</ul>
|
||||||
|
<div
|
||||||
|
@mouseover="this.image = variant.image"
|
||||||
|
v-for="variant in variants"
|
||||||
|
:key="variant.id"
|
||||||
|
>
|
||||||
|
{{ variant.color }}
|
||||||
|
</div>
|
||||||
|
<button class="button" @click="cart++">
|
||||||
|
Add to Cart
|
||||||
|
</button>
|
||||||
|
|
||||||
<!-- Mount App -->
|
<button class="button" @click="cart--" v-if="cart > 0">
|
||||||
<script>
|
Remove item
|
||||||
const mountedApp = app.mount('#app')
|
</button>
|
||||||
</script>
|
</div>
|
||||||
</body>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Import App -->
|
||||||
|
<script src="./main.js"></script>
|
||||||
|
|
||||||
|
<!-- Mount App -->
|
||||||
|
<script>
|
||||||
|
const mountedApp = app.mount("#app");
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user