-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html~
55 lines (49 loc) · 1.59 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>Vue.js App</title>
<link href="main.css" rel="stylesheet">
</head>
<body>
<div id="app">
<p>{{message.value}}</p>
<input v-model="message.value">
<p v-if="show">Hello Vue.js</p>
<ol>
<li v-for="item in list">{{item}}</li>
</ol>
<button v-on:click="show=!show">Change</button>
<transition>
<p v-if="show">Hello Vue.js!</p>
</transition>
<p>{{count}}clicked!</p>
<button v-on:click="increment">count</button>
<h2>data binding</h2>
<p>{{message.value}}</p>
<p>{{message.value.length}}</p>
<p>{{list[2]}}</p>
<p>{{list[num]}}</p>
<input type="text" v-bind:value="message">
<p v-bind:class="classObject">Text</p>
<p v-bind:style="styleObject">Text</p>
<div v-if="ok">v-if conditional branching</div>
<div v-show="ok">v-show conditional branching</div>
<ul>
<li v-for="item in list1" v-bind:key="item.id" v-bind:class="{tuyoi:item.hp>300}">
ID.{{item.id}} {{item.name}} HP.{{item.hp}}
<span v-if="item.hp>300">strong!</span>
</li>
</ul>
<input v-model="name">
<button v-on:click="doAdd">Add monster</button>
<ul>
<li v-for="item in list" v-bind:key="item.id">
ID.{{item.id}}{{item.name}} HP.{{item.hp}}
</li>
</ul>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script src="main.js"></script>
</body>
</html>