-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
59 lines (54 loc) · 1.33 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
<!--
* @Description:
* @Version: 2.0
* @Autor: yaomingfei
* @Date: 2020-01-09 16:30:57
* @LastEditors : yaomingfei
* @LastEditTime : 2020-01-09 17:10:02
-->
<!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>vue源码初步学习</title>
<script src="./compile.js"></script>
<script src="./kvue.js"></script>
</head>
<body>
<div id="app">
<p>{{name}}</p>
<p k-text="name"></p>
<p>{{age}}</p>
<p>{{doubleAge}} </p>
<input type="text" k-model="name">
<button @click="changeName">呵呵</button>
<div k-html="html"></div>
</div>
</body>
<script>
let myVue = new KVue({
el: '#app',
data: {
name: "I am test.",
age: 12,
html: '<button>这是一个按钮</button>'
},
created() {
console.log('开始啦')
setTimeout(() => {
this.name = '我是蜗牛'
}, 1500)
},
methods: {
changeName() {
this.name = '哈喽'
this.age = 1
this.id = 'xx'
console.log(1, this)
}
}
})
</script>
</html>