forked from shenghy/VueDemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotherOption.html
39 lines (35 loc) · 903 Bytes
/
otherOption.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<script type="text/javascript" src="../assets/js/vue.js"></script>
<title>Other Option Demo</title>
</head>
<body>
<h1>Other Option Demo</h1>
<hr>
<div id="app">
<hello></hello>
<world></world>
</div>
<script type="text/javascript">
Vue.component('hello',{
template:`<div>{this.$parent.message}我是全局化注册的-<hello></div>`,
//替换插值符号
delimiters:['{','}']
})
var world={
template:'<div>{{this.$parent.message}}局部注册的-<world></div>'
}
var app=new Vue({
el:'#app',
data:{
message:'hello Vue!'
},
components:{
"world":world
}
})
</script>
</body>
</html>