-
Notifications
You must be signed in to change notification settings - Fork 0
/
twoway-databinding-2.html
53 lines (52 loc) · 2.27 KB
/
twoway-databinding-2.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Vue Crash Course</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" integrity="sha384-gH2yIJqKdNHPEq0n4Mqa/HGKIhSkIHeL5AyhkYV8i59U5AR6csBvApHHNl/vI1Bx" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.global.js"></script>
</head>
<body>
<div class="container">
<div id="app">
<form action="">
<div class="col-sm6">
<input v-model="options" type="text" class="form-control">
</div>
<fieldset class="form-group">
<legend>Radio buttons</legend>
<div class="form-check">
<label class="form-check-label">
<input v-model="options" type="checkbox" class="form-check-input" name="optionsRadios" id="optionsRadios1" value="option-1" checked>
Option one is this and that—be sure to include why it's great
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input v-model="options" type="checkbox" class="form-check-input" name="optionsRadios" id="optionsRadios2" value="option-2">
Option two can be something else and selecting it will deselect option one
</label>
</div>
<div class="form-check">
<label class="form-check-label">
<input v-model="options" type="checkbox" class="form-check-input" name="optionsRadios" id="optionsRadios3" value="option-3">
Option three is disabled
</label>
</div>
</fieldset>
<p> You selected {{options.join(', ')}} </p>
</form>
</div>
</div>
<script>
let app = Vue.createApp({
data() {
return {
options: [],
message: ''
}
}
}).mount('#app')
</script>
</body>
</html>