-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
37 lines (37 loc) · 1.47 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>はじめてのVue.js</title>
<script src="https://unpkg.com/[email protected]"></script>
</head>
<body>
<div id="app">
<ul>
<li v-for="item in items" v-bind:key="item.name">
{{ item.name }}の個数: <input type="number" v-model.lazy="item.quantity" min="0">
</li>
</ul>
<hr>
<div v-bind:style="errorMessageStyle">
<ul>
<li v-for="item in items" v-bind:key="item.name">
{{ item.name }}: {{ item.price }} x {{ item.quantity }} = {{ item.price * item.quantity | numberWithDelimiter }}円
</li>
</ul>
<p>{{ items[0].name }}: {{ items[0].price }} x {{ items[0].quantity }}</p>
<p>小形: {{ totalPrice | numberWithDelimiter }}円</p>
<p>合計(税込): {{ totalPriceWithTax | numberWithDelimiter }}円</p>
<p v-show="!canBuy">
{{ 1000 | numberWithDelimiter }}以上からご購入いただけます
</p>
<button v-bind:disabled="!canBuy" v-on:click="doBuy">購入</button>
</div>
</div>
<script>
console.assert(typeof Vue !== 'undefined');
</script>
<script src="./app.js"></script>
</body>
</html>