File tree Expand file tree Collapse file tree 3 files changed +36
-52
lines changed Expand file tree Collapse file tree 3 files changed +36
-52
lines changed Original file line number Diff line number Diff line change 1
1
import util , { warn , mapParams } from './util'
2
- import initMixin from './mixin '
2
+ import applyOverride from './override '
3
3
import Recognizer from 'route-recognizer'
4
4
import Route from './route'
5
5
import Transition from './transition'
@@ -563,7 +563,7 @@ Router.install = function (externalVue) {
563
563
return
564
564
}
565
565
Vue = externalVue
566
- initMixin ( Vue )
566
+ applyOverride ( Vue )
567
567
View ( Vue )
568
568
Link ( Vue )
569
569
util . Vue = Vue
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ export default function ( Vue ) {
2
+
3
+ const _ = Vue . util
4
+
5
+ const init = Vue . prototype . _init
6
+ Vue . prototype . _init = function ( options ) {
7
+ const root = options . _parent || options . parent || this
8
+ const route = root . $route
9
+ if ( route ) {
10
+ route . router . _children . push ( this )
11
+ if ( ! this . $route ) {
12
+ if ( this . _defineMeta ) {
13
+ // 0.12
14
+ this . _defineMeta ( '$route' , route )
15
+ } else {
16
+ // 1.0
17
+ _ . defineReactive ( this , '$route' , route )
18
+ }
19
+ }
20
+ }
21
+ init . call ( this , options )
22
+ }
23
+
24
+ const destroy = Vue . prototype . _destroy
25
+ Vue . prototype . _destroy = function ( ) {
26
+ if ( ! this . _isBeingDestroyed ) {
27
+ const route = this . $root . $route
28
+ if ( route ) {
29
+ route . router . _children . $remove ( this )
30
+ }
31
+ destroy . apply ( this , arguments )
32
+ }
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments