File tree 4 files changed +11
-7
lines changed
4 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ var root = new Vue({
12
12
el : '#app' ,
13
13
components : {
14
14
inbox : {
15
- template : '<div><h2>inbox!</h2><div v -view></div></div >' ,
15
+ template : '<div><h2>inbox!</h2><router -view></router-view >' ,
16
16
replace : true ,
17
17
components : {
18
18
message : {
@@ -26,7 +26,7 @@ var root = new Vue({
26
26
}
27
27
} ,
28
28
user : {
29
- template : '<h2>User yo</h2><div v -view></div >' ,
29
+ template : '<h2>User yo</h2><router -view></router-view >' ,
30
30
components : {
31
31
'user-profile' : {
32
32
template : 'user profile {{route.params.userId}} {{route.params.something}}'
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ <h1>App Header</h1>
12
12
< a v-link ="/inbox/message/123 "> inbox</ a >
13
13
< a v-link ="/about "> about</ a >
14
14
< a v-link ="/user/1234 "> user</ a >
15
- < div v -view class ="test " v-transition ="test " transition-mode ="out-in "> </ div >
15
+ < router -view class ="test " v-transition ="test " transition-mode ="out-in "> </ router-view >
16
16
</ div >
17
17
18
18
< script src ="/example.build.js "> </ script >
Original file line number Diff line number Diff line change 34
34
"webpack" : " ^1.8.11"
35
35
},
36
36
"dependencies" : {
37
- "route-recognizer" : " ^0.1.5"
37
+ "route-recognizer" : " ^0.1.5" ,
38
+ "insert-css" : " ^0.2.0"
38
39
}
39
40
}
Original file line number Diff line number Diff line change 2
2
3
3
module . exports = function ( Vue ) {
4
4
5
+ // insert global css to make sure router-view has
6
+ // display:block so that transitions work properly
7
+ require ( 'insert-css' ) ( 'router-view{display:block;}' )
8
+
5
9
var _ = Vue . util
6
- var component = Vue . directive ( 'component ' )
10
+ var component = Vue . directive ( '_component ' )
7
11
var templateParser = Vue . parsers . template
8
12
9
13
// v-view extends v-component
@@ -96,6 +100,5 @@ module.exports = function (Vue) {
96
100
97
101
} )
98
102
99
- Vue . directive ( 'view' , viewDef )
100
- Vue . config . _terminalDirectives . push ( 'view' )
103
+ Vue . elementDirective ( 'router-view' , viewDef )
101
104
}
You can’t perform that action at this time.
0 commit comments