-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
100 lines (85 loc) · 2.88 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
<script src="./app.js" defer></script>
<link rel="stylesheet" href="./main.css" />
<link rel="icon" href="https://img.icons8.com/color/48/000000/vue-js.png" />
<title>Vue Basics</title>
</head>
<body>
<h2><span class="typed"></span></h2>
<div id="app">
<h1>{{ title }}</h1>
<!-- Basic -->
<input v-model="heading" placeholder="Write Something.." />
<h1>{{ heading }}</h1>
<!-- Using v-for and binding key -->
<h1>Iterating over an array</h1>
<ul>
<li v-for="item in items" :key="item.id">{{ item.label }}</li>
</ul>
<!-- Adding Elements in an Array -->
<h1>Adding elements in an Array</h1>
<h3>Select Ice cream Flavours</h3>
<label
><input
type="checkbox"
v-model="itemArray"
value="Vanilla"
/>Vanilla</label
>
<label
><input
type="checkbox"
v-model="itemArray"
value="Strawberry"
/>Strawberry</label
>
<label
><input
type="checkbox"
v-model="itemArray"
value="Chocolate"
/>Chocolate</label
>
<label
><input
type="checkbox"
v-model="itemArray"
value="Butterscotch"
/>Butterscotch</label
>
<br />
<ul>
<li v-for="item in itemArray">{{ item }}</li>
</ul>
<!-- Using v-ifelse for conditional rendering -->
<h1>Conditional Rendering</h1>
<button @click="awesome = !awesome">Toggle Button</button>
<h4 v-if="awesome">Vue is awesome!</h4>
<h4 v-else>Oh no 😢</h4>
<!-- Using @click for event handling -->
<h1>Event Handling</h1>
<button @click="count++">Add +1</button>
<p>Count is: {{ count }}</p>
<!-- Using v-for with an Object -->
<h1>List Rendering with Object</h1>
<ul>
<li v-for="(value, key, index) in myObject">
{{ index }}. {{ key }}: {{ value }}
</li>
</ul>
</div>
<h1>Bulk Typing Using Typed.js</h1>
<h2><span class="typedBulk"></span></h2>
<script src="https://cdnjs.cloudflare.com/ajax/libs/typed.js/2.0.0/typed.js"></script>
</body>
</html>