-
Notifications
You must be signed in to change notification settings - Fork 0
/
08-vue基础结构.html
40 lines (35 loc) · 926 Bytes
/
08-vue基础结构.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>vue 基础结构</title>
</head>
<body>
<div id="app">
<h1>插值表达式</h1>
<h3>{{ msg }}</h3>
<h3>{{ count }}</h3>
<h1>v-text</h1>
<div v-text="msg"></div>
<h1>v-model</h1>
<input type="text" v-model="msg">
<input type="text" v-model="count">
<h1>text-obj-reactive</h1>
<div>{{msg}} | {{msg.name}}</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]"></script>
<script>
let vm = new Vue({
el: "#app",
data: {
msg: "hello world",
count: 20,
}
});
setTimeout(() => {
vm.msg = { name: "cai", age: "xxx" }
}, 5000);
</script>
</body>
</html>