-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
173 lines (160 loc) · 3.36 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta
name="viewport",
content="width=device-width, initial-scale=1.0"
>
<title>
Vue Thingymabob
</title>
</head>
<body>
<div id="root">
<h1>Welcome to Vue, where the goats totally roam free.</h1>
<div>
<h2>Colors and stuff:</h2>
<color-box color="red"></color-box>
<color-box color="orange"></color-box>
<color-box color="yellow"></color-box>
<color-box color="green"></color-box>
<color-box color="blue"></color-box>
<color-box color="purple"></color-box>
<color-box color="pink"></color-box>
</div>
<p>
The clock is currently {{clock}}.
</p>
<br>
<p>
What are the goats hungry for today?
</p>
<div>
<input
type="text"
v-model="foodName"
>
</div>
<br>
<p>
How many {{foodName}} would you like to feed to the goats?
</p>
<div>
<input
type="number"
v-model="foodCount"
>
</div>
<br>
<p>
We have {{goatCount}} goats up in here who are hungry for {{foodName}}!
</p>
<p>
The goats are {{mood}}, because we have {{foodCount}} {{foodName}}.
</p>
<br>
<p>
We happen to have some VIP goats:
<ul>
<!-- for loop using v-for -->
<li
v-for="goat in vipList"
>{{goat}}
</li>
</ul>
</p>
<div>
<input
type="text"
v-model="vipName"
>
<button @click="addVIP">
Add goat to VIP list.
</button>
</div>
<div>
<h1>Goat Object Form</h1>
<div>
<label>
<span>Name</span>
<input
type="text"
v-model="goatObject.name"
>
</label>
</div>
<div>
<label>
<span>Power Level: </span>
<input
type="range"
v-model.number="goatObject.powerLevel"
min="1"
max="65535"
>
</label>
</div>
<div>
<label>
<span>Is Grumpy?</span>
<input
type="checkbox"
v-model="goatObject.isGrumpy"
>
</label>
</div>
<button @click="addGoatObject">
Add goat to goat list.
</button>
<pre>Current goat: {{goatObject}}</pre>
<pre>Current goat list: {{goatList}}</pre>
</div>
<br>
<p>
Do more stuff:
</p>
<div>
<button @click="addGoats(2)">
ADD 2 GOATS NOW
</button>
<p>
OR
</p>
<button @click="addGoats(5)">
ADD 5 GOATS NOW
</button>
<br>
<br>
<br>
<p>
Or if you are <em><strong>evil</strong></em>...
</p>
<button @click="addGoats(-1)">
CONSUME A GOAT (Why??)
</button>
</div>
</div>
<div id="notVue">
<button id="notVueButton">
This button isn't Vue.
</button>
</div>
<script
type="text/x-template"
id="template-color-box">
<div
class="color-box"
:style="{backgroundColor: color}"
>
{{color}}
</div>
</script>
<script
src="https://unpkg.com/vue@3/dist/vue.global.js">
</script>
<script
src="./index.js">
</script>
</body>
</html>