-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
42 lines (42 loc) · 1.14 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Form Input Binding</title>
</head>
<body>
<div id="root">
<section>
<select v-model="selected">
<option v-for="option in options" v-bind:value="option.value">
{{ option.text }}
</option>
</select>
<p>Selected option: {{ selected }}</p>
</section>
<section>
<input type="text" v-model="inputs.text" />
<p><strong>Text:</strong> {{ inputs.text }}</p>
</section>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/vue.js"></script>
<script>
new Vue({
el: '#root',
data: {
selected: 'A',
options: [
{ text: 'first option', value: 'A' },
{ text: 'second option', value: 'B' },
{ text: 'third option', value: 'C' }
],
inputs: {
text: 'some initial text'
}
}
});
</script>
</body>
</html>