-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
117 lines (87 loc) · 2.71 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Introdução ao Vue JS</title>
<script src="https://unpkg.com/vue"></script>
</head>
<body>
<div id="app">
<gui-titulo titulo="Formulários"></gui-titulo>
<p>Texto: {{texto}}</p>
<p>
<input type="text" v-model="texto">
</p>
<p>Textarea: {{textarea}}</p>
<p style="white-space: pre-line">{{textarea}}</p>
<p>
<textarea v-model="textarea" rows="8" cols="80"></textarea>
</p>
<p>Checkbox:</p>
<input type="checkbox" id="aceitaTermos" v-model="termos" >
<label for="aceitaTermos">{{termos}}</label>
<p>Multiple Checkboxes: {{notificacoes}}</p>
<p>
<input type="checkbox" id="receberEmail" value="email" v-model="notificacoes" >
<label for="receberEmail">Receber e-mail</label>
<input type="checkbox" id="receberSMS" value="sms" v-model="notificacoes" >
<label for="receberSMS">Receber SMS</label>
<input type="checkbox" id="receberTel" value="tel" v-model="notificacoes" >
<label for="receberTel">Receber Ligação</label>
</p>
<p>Radio: {{sexo}}</p>
<p>
<input type="radio" id="masculino" value="M" v-model="sexo" >
<label for="masculino">Masculino</label>
<input type="radio" id="feminino" value="F" v-model="sexo" >
<label for="feminino">Feminino</label>
</p>
<p>Select {{ano}}</p>
<p>
<select v-model="ano">
<option disabled value="">Escolha o ano</option>
<option value="2017">Ano 2017</option>
<option value="2018">Ano 2018</option>
<option value="2019">Ano 2019</option>
</select>
</p>
<p>Multiple Selects {{cores}}</p>
<p>
<select multiple v-model="cores">
<option disabled value="">Escolha as cores</option>
<option>Azul</option>
<option>Verde</option>
<option>Vermelho</option>
</select>
</p>
<p>Lazy: {{busca}}</p>
<p>
<input type="text" v-model.lazy="busca">
</p>
<p>Number: {{idade}} - tipo: {{typeof idade}}</p>
<p>
<input type="number" v-model.number="idade">
</p>
</div>
<script type="text/javascript">
Vue.component('gui-titulo',{
props:['titulo'],
template:'<h2>{{ titulo }}</h2>'
});
var app = new Vue({
el:"#app",
data:{
texto:'',
textarea:'',
termos:false,
notificacoes:[],
sexo:null,
ano:2019,
cores:['Verde','Vermelho','Azul'],
busca:'',
idade:null
}
});
</script>
</body>
</html>