-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtext.html
53 lines (50 loc) · 1.6 KB
/
text.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">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Text</title>
<style>
.aa {
color: red;
width: 300px;
}
.bb {
background: yellow;
}
</style>
<!-- <script src="./lib/Vue-2.4.0.js"></script> -->
</head>
<!-- 在body里,<div>标签后面的换行符也是文档的一部分,属于text类型,nodeName: '#text',data: "↵ ",textContent: "↵ "-->
<!-- 同样的,注释掉的内容也是文档的一部分,属于comment类型,nodeName:'#comment',data里是注释掉的内容 -->
<!-- 若要访问元素节点中的内容应该使用textContent属性 -->
<body>
<div id="myVue_app">
<div class="bb" v-class="myClass">123321123321</div>
<p>{{ name }}</p>
<input v-model="str" type="text">
<button v-on:click='show'>提交</button>
</div>
<script src="./js/myObserver.js"></script>
<script src="./js/myWatcher.js"></script>
<script src="./js/myCompile.js"></script>
<script src="./js/myVue.js"></script>
<script>
const vm = new myVue({
el: '#myVue_app',
data: {
str: '初始化的str',
name: 'wyk',
myClass: "aa",
msg: "<a href='https://www.baidu.com'>百度</a>"
},
methods: {
show(){
alert(this.str)
}
},
})
</script>
</body>
</html>