Skip to content

Commit 721794b

Browse files
committed
1.0.0-alpha.3 compat
1 parent 3833885 commit 721794b

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/directives/view.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,21 @@ export default function (Vue) {
2727
this._isDynamicLiteral = true
2828
// finally, init by delegating to v-component
2929
componentDef.bind.call(this)
30+
3031
// does not support keep-alive.
3132
/* istanbul ignore if */
3233
if (this.keepAlive) {
3334
this.keepAlive = false
3435
warn('<router-view> does not support keep-alive.')
3536
}
37+
/* istanbul ignore if */
38+
if (this.waitForEvent) {
39+
this.waitForEvent = null
40+
warn(
41+
'<router-view> does not support wait-for. Use ' +
42+
'the acitvate route hook instead.'
43+
)
44+
}
3645

3746
// all we need to do here is registering this view
3847
// in the router. actual component switching will be

src/pipeline.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ export function deactivate (view, transition, next) {
100100
export function activate (view, transition, depth, cb) {
101101
let handler = transition.activateQueue[depth]
102102
if (!handler) {
103-
view.setComponent(null)
103+
// fix 1.0.0-alpha.3 compat
104+
if (view._bound) {
105+
view.setComponent(null)
106+
}
104107
cb && cb()
105108
return
106109
}
@@ -135,7 +138,13 @@ export function activate (view, transition, depth, cb) {
135138
view.transition(component)
136139
} else {
137140
// no transition on first render, manual transition
138-
view.setCurrent(component)
141+
if (view.setCurrent) {
142+
// 0.12 compat
143+
view.setCurrent(component)
144+
} else {
145+
// 1.0
146+
view.childVM = component
147+
}
139148
component.$before(view.anchor, null, false)
140149
}
141150
cb && cb()

0 commit comments

Comments
 (0)