Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

L4 start #142

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,34 @@
<!-- Import Styles -->
<link rel="stylesheet" href="./assets/styles.css" />
<!-- Import Vue.js -->
<script src="https://unpkg.com/[email protected].0-beta.12/dist/vue.global.js"></script>
<script src="https://unpkg.com/[email protected].11/dist/vue.global.js"></script>
</head>
<body>
<div id="app">
<h1>Product goes here</h1>
<div class="nav-bar"></div>

<div class="product-display">
<div class="product-container">
<div class="product-image">
<img :src="image">
</div>
<div class="product-info">
<h1>{{ product }}</h1>
<p v-if="inventory > 10">In stock</p>
<p v-else-if="inventory <= 10 && inventory > 0">Almost sold out</p>
<p v-else>Out of stock</p>
<p v-show="onSale">Sale</p>
</div>
</div>
</div>
</div>

<!-- Import Js -->
<!-- Import App -->
<script src="./main.js"></script>

<!-- Mount App -->
<script>
const mountedApp = app.mount('#app')
</script>
</body>
</html>
11 changes: 10 additions & 1 deletion main.js
Original file line number Diff line number Diff line change
@@ -1 +1,10 @@
const product = 'Socks'
const app = Vue.createApp({
data() {
return {
product: 'Socks',
image: './assets/images/socks_blue.jpg',
inventory: 0,
onSale: false
}
}
})