Skip to content

Commit 2e9781c

Browse files
committed
tweak instance properties
1 parent 3ddca88 commit 2e9781c

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/components/link.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export default {
2323
const base = router.history.base
2424
const href = base ? cleanPath(base + fullPath) : fullPath
2525
const classes = {}
26-
const activeClass = this.activeClass || router._options.linkActiveClass || 'router-link-active'
26+
const activeClass = this.activeClass || router.options.linkActiveClass || 'router-link-active'
2727
classes[activeClass] = this.exact
2828
? current.path === resolved.path
2929
: current.path.indexOf(resolved.path) === 0

src/index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ import { inBrowser, supportsHistory } from './util/dom'
77

88
export default class VueRouter {
99
constructor (options = {}) {
10-
this._rootComponent = null
11-
this._options = options
12-
10+
this.app = null
11+
this.options = options
1312
this.match = createMatcher(options.routes || [])
1413

1514
let mode = options.mode || 'hash'
@@ -19,7 +18,7 @@ export default class VueRouter {
1918
if (!inBrowser) {
2019
mode = 'abstract'
2120
}
22-
this._mode = mode
21+
this.mode = mode
2322

2423
switch (mode) {
2524
case 'history':
@@ -36,7 +35,7 @@ export default class VueRouter {
3635
}
3736

3837
this.history.listen(location => {
39-
this._rootComponent._route = location
38+
this.app._route = location
4039
})
4140
}
4241

src/install.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export function install (Vue) {
1414
beforeCreate () {
1515
if (this.$options.router) {
1616
this._router = this.$options.router
17-
this._router._rootComponent = this
17+
this._router.app = this
1818
Vue.util.defineReactive(this, '_route', this._router.history.current)
1919
}
2020
}

0 commit comments

Comments
 (0)