kdu-router 3.1.3 → 3.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +20 -56
- package/dist/kdu-router.common.js +2917 -2881
- package/dist/kdu-router.esm.browser.js +2867 -2831
- package/dist/kdu-router.esm.browser.min.js +11 -6
- package/dist/kdu-router.esm.js +2915 -2879
- package/dist/kdu-router.js +2923 -2887
- package/dist/kdu-router.min.js +11 -6
- package/package.json +81 -107
- package/src/components/link.js +190 -0
- package/src/components/view.js +149 -0
- package/src/create-matcher.js +200 -200
- package/src/create-route-map.js +205 -205
- package/src/history/abstract.js +69 -0
- package/src/history/base.js +352 -0
- package/src/history/errors.js +22 -0
- package/src/history/hash.js +154 -0
- package/src/history/html5.js +80 -0
- package/src/index.js +261 -261
- package/src/install.js +52 -52
- package/src/util/async.js +18 -0
- package/src/util/dom.js +3 -0
- package/src/util/location.js +69 -0
- package/src/util/misc.js +6 -0
- package/src/util/params.js +37 -0
- package/src/util/path.js +74 -0
- package/src/util/push-state.js +46 -0
- package/src/util/query.js +95 -0
- package/src/util/resolve-components.js +108 -0
- package/src/util/route.js +132 -0
- package/src/util/scroll.js +156 -0
- package/src/util/state-key.js +22 -0
- package/src/util/warn.js +25 -0
- package/types/index.d.ts +16 -16
- package/types/kdu.d.ts +22 -22
- package/types/router.d.ts +145 -145
package/src/create-route-map.js
CHANGED
|
@@ -1,205 +1,205 @@
|
|
|
1
|
-
/* @flow */
|
|
2
|
-
|
|
3
|
-
import Regexp from 'path-to-regexp'
|
|
4
|
-
import { cleanPath } from './util/path'
|
|
5
|
-
import { assert, warn } from './util/warn'
|
|
6
|
-
|
|
7
|
-
export function createRouteMap (
|
|
8
|
-
routes: Array<RouteConfig>,
|
|
9
|
-
oldPathList?: Array<string>,
|
|
10
|
-
oldPathMap?: Dictionary<RouteRecord>,
|
|
11
|
-
oldNameMap?: Dictionary<RouteRecord>
|
|
12
|
-
): {
|
|
13
|
-
pathList: Array<string>,
|
|
14
|
-
pathMap: Dictionary<RouteRecord>,
|
|
15
|
-
nameMap: Dictionary<RouteRecord>
|
|
16
|
-
} {
|
|
17
|
-
// the path list is used to control path matching priority
|
|
18
|
-
const pathList: Array<string> = oldPathList || []
|
|
19
|
-
// $flow-disable-line
|
|
20
|
-
const pathMap: Dictionary<RouteRecord> = oldPathMap || Object.create(null)
|
|
21
|
-
// $flow-disable-line
|
|
22
|
-
const nameMap: Dictionary<RouteRecord> = oldNameMap || Object.create(null)
|
|
23
|
-
|
|
24
|
-
routes.forEach(route => {
|
|
25
|
-
addRouteRecord(pathList, pathMap, nameMap, route)
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
// ensure wildcard routes are always at the end
|
|
29
|
-
for (let i = 0, l = pathList.length; i < l; i++) {
|
|
30
|
-
if (pathList[i] === '*') {
|
|
31
|
-
pathList.push(pathList.splice(i, 1)[0])
|
|
32
|
-
l--
|
|
33
|
-
i--
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
if (process.env.NODE_ENV === 'development') {
|
|
38
|
-
// warn if routes do not include leading slashes
|
|
39
|
-
const found = pathList
|
|
40
|
-
// check for missing leading slash
|
|
41
|
-
.filter(path => path && path.charAt(0) !== '*' && path.charAt(0) !== '/')
|
|
42
|
-
|
|
43
|
-
if (found.length > 0) {
|
|
44
|
-
const pathNames = found.map(path => `- ${path}`).join('\n')
|
|
45
|
-
warn(false, `Non-nested routes must include a leading slash character. Fix the following routes: \n${pathNames}`)
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return {
|
|
50
|
-
pathList,
|
|
51
|
-
pathMap,
|
|
52
|
-
nameMap
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function addRouteRecord (
|
|
57
|
-
pathList: Array<string>,
|
|
58
|
-
pathMap: Dictionary<RouteRecord>,
|
|
59
|
-
nameMap: Dictionary<RouteRecord>,
|
|
60
|
-
route: RouteConfig,
|
|
61
|
-
parent?: RouteRecord,
|
|
62
|
-
matchAs?: string
|
|
63
|
-
) {
|
|
64
|
-
const { path, name } = route
|
|
65
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
-
assert(path != null, `"path" is required in a route configuration.`)
|
|
67
|
-
assert(
|
|
68
|
-
typeof route.component !== 'string',
|
|
69
|
-
`route config "component" for path: ${String(
|
|
70
|
-
path || name
|
|
71
|
-
)} cannot be a ` + `string id. Use an actual component instead.`
|
|
72
|
-
)
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const pathToRegexpOptions: PathToRegexpOptions =
|
|
76
|
-
route.pathToRegexpOptions || {}
|
|
77
|
-
const normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict)
|
|
78
|
-
|
|
79
|
-
if (typeof route.caseSensitive === 'boolean') {
|
|
80
|
-
pathToRegexpOptions.sensitive = route.caseSensitive
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const record: RouteRecord = {
|
|
84
|
-
path: normalizedPath,
|
|
85
|
-
regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
|
|
86
|
-
components: route.components || { default: route.component },
|
|
87
|
-
instances: {},
|
|
88
|
-
name,
|
|
89
|
-
parent,
|
|
90
|
-
matchAs,
|
|
91
|
-
redirect: route.redirect,
|
|
92
|
-
beforeEnter: route.beforeEnter,
|
|
93
|
-
meta: route.meta || {},
|
|
94
|
-
props:
|
|
95
|
-
route.props == null
|
|
96
|
-
? {}
|
|
97
|
-
: route.components
|
|
98
|
-
? route.props
|
|
99
|
-
: { default: route.props }
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (route.children) {
|
|
103
|
-
// Warn if route is named, does not redirect and has a default child route.
|
|
104
|
-
// If users navigate to this route by name, the default child will
|
|
105
|
-
// not be rendered (GH Issue #629)
|
|
106
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
107
|
-
if (
|
|
108
|
-
route.name &&
|
|
109
|
-
!route.redirect &&
|
|
110
|
-
route.children.some(child => /^\/?$/.test(child.path))
|
|
111
|
-
) {
|
|
112
|
-
warn(
|
|
113
|
-
false,
|
|
114
|
-
`Named Route '${route.name}' has a default child route. ` +
|
|
115
|
-
`When navigating to this named route (:to="{name: '${
|
|
116
|
-
route.name
|
|
117
|
-
}'"), ` +
|
|
118
|
-
`the default child route will not be rendered. Remove the name from ` +
|
|
119
|
-
`this route and use the name of the default child route for named ` +
|
|
120
|
-
`links instead.`
|
|
121
|
-
)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
route.children.forEach(child => {
|
|
125
|
-
const childMatchAs = matchAs
|
|
126
|
-
? cleanPath(`${matchAs}/${child.path}`)
|
|
127
|
-
: undefined
|
|
128
|
-
addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs)
|
|
129
|
-
})
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (!pathMap[record.path]) {
|
|
133
|
-
pathList.push(record.path)
|
|
134
|
-
pathMap[record.path] = record
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (route.alias !== undefined) {
|
|
138
|
-
const aliases = Array.isArray(route.alias) ? route.alias : [route.alias]
|
|
139
|
-
for (let i = 0; i < aliases.length; ++i) {
|
|
140
|
-
const alias = aliases[i]
|
|
141
|
-
if (process.env.NODE_ENV !== 'production' && alias === path) {
|
|
142
|
-
warn(
|
|
143
|
-
false,
|
|
144
|
-
`Found an alias with the same value as the path: "${path}". You have to remove that alias. It will be ignored in development.`
|
|
145
|
-
)
|
|
146
|
-
// skip in dev to make it work
|
|
147
|
-
continue
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
const aliasRoute = {
|
|
151
|
-
path: alias,
|
|
152
|
-
children: route.children
|
|
153
|
-
}
|
|
154
|
-
addRouteRecord(
|
|
155
|
-
pathList,
|
|
156
|
-
pathMap,
|
|
157
|
-
nameMap,
|
|
158
|
-
aliasRoute,
|
|
159
|
-
parent,
|
|
160
|
-
record.path || '/' // matchAs
|
|
161
|
-
)
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
if (name) {
|
|
166
|
-
if (!nameMap[name]) {
|
|
167
|
-
nameMap[name] = record
|
|
168
|
-
} else if (process.env.NODE_ENV !== 'production' && !matchAs) {
|
|
169
|
-
warn(
|
|
170
|
-
false,
|
|
171
|
-
`Duplicate named routes definition: ` +
|
|
172
|
-
`{ name: "${name}", path: "${record.path}" }`
|
|
173
|
-
)
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function compileRouteRegex (
|
|
179
|
-
path: string,
|
|
180
|
-
pathToRegexpOptions: PathToRegexpOptions
|
|
181
|
-
): RouteRegExp {
|
|
182
|
-
const regex = Regexp(path, [], pathToRegexpOptions)
|
|
183
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
184
|
-
const keys: any = Object.create(null)
|
|
185
|
-
regex.keys.forEach(key => {
|
|
186
|
-
warn(
|
|
187
|
-
!keys[key.name],
|
|
188
|
-
`Duplicate param keys in route with path: "${path}"`
|
|
189
|
-
)
|
|
190
|
-
keys[key.name] = true
|
|
191
|
-
})
|
|
192
|
-
}
|
|
193
|
-
return regex
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
function normalizePath (
|
|
197
|
-
path: string,
|
|
198
|
-
parent?: RouteRecord,
|
|
199
|
-
strict?: boolean
|
|
200
|
-
): string {
|
|
201
|
-
if (!strict) path = path.replace(/\/$/, '')
|
|
202
|
-
if (path[0] === '/') return path
|
|
203
|
-
if (parent == null) return path
|
|
204
|
-
return cleanPath(`${parent.path}/${path}`)
|
|
205
|
-
}
|
|
1
|
+
/* @flow */
|
|
2
|
+
|
|
3
|
+
import Regexp from 'path-to-regexp'
|
|
4
|
+
import { cleanPath } from './util/path'
|
|
5
|
+
import { assert, warn } from './util/warn'
|
|
6
|
+
|
|
7
|
+
export function createRouteMap (
|
|
8
|
+
routes: Array<RouteConfig>,
|
|
9
|
+
oldPathList?: Array<string>,
|
|
10
|
+
oldPathMap?: Dictionary<RouteRecord>,
|
|
11
|
+
oldNameMap?: Dictionary<RouteRecord>
|
|
12
|
+
): {
|
|
13
|
+
pathList: Array<string>,
|
|
14
|
+
pathMap: Dictionary<RouteRecord>,
|
|
15
|
+
nameMap: Dictionary<RouteRecord>
|
|
16
|
+
} {
|
|
17
|
+
// the path list is used to control path matching priority
|
|
18
|
+
const pathList: Array<string> = oldPathList || []
|
|
19
|
+
// $flow-disable-line
|
|
20
|
+
const pathMap: Dictionary<RouteRecord> = oldPathMap || Object.create(null)
|
|
21
|
+
// $flow-disable-line
|
|
22
|
+
const nameMap: Dictionary<RouteRecord> = oldNameMap || Object.create(null)
|
|
23
|
+
|
|
24
|
+
routes.forEach(route => {
|
|
25
|
+
addRouteRecord(pathList, pathMap, nameMap, route)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
// ensure wildcard routes are always at the end
|
|
29
|
+
for (let i = 0, l = pathList.length; i < l; i++) {
|
|
30
|
+
if (pathList[i] === '*') {
|
|
31
|
+
pathList.push(pathList.splice(i, 1)[0])
|
|
32
|
+
l--
|
|
33
|
+
i--
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if (process.env.NODE_ENV === 'development') {
|
|
38
|
+
// warn if routes do not include leading slashes
|
|
39
|
+
const found = pathList
|
|
40
|
+
// check for missing leading slash
|
|
41
|
+
.filter(path => path && path.charAt(0) !== '*' && path.charAt(0) !== '/')
|
|
42
|
+
|
|
43
|
+
if (found.length > 0) {
|
|
44
|
+
const pathNames = found.map(path => `- ${path}`).join('\n')
|
|
45
|
+
warn(false, `Non-nested routes must include a leading slash character. Fix the following routes: \n${pathNames}`)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return {
|
|
50
|
+
pathList,
|
|
51
|
+
pathMap,
|
|
52
|
+
nameMap
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function addRouteRecord (
|
|
57
|
+
pathList: Array<string>,
|
|
58
|
+
pathMap: Dictionary<RouteRecord>,
|
|
59
|
+
nameMap: Dictionary<RouteRecord>,
|
|
60
|
+
route: RouteConfig,
|
|
61
|
+
parent?: RouteRecord,
|
|
62
|
+
matchAs?: string
|
|
63
|
+
) {
|
|
64
|
+
const { path, name } = route
|
|
65
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
66
|
+
assert(path != null, `"path" is required in a route configuration.`)
|
|
67
|
+
assert(
|
|
68
|
+
typeof route.component !== 'string',
|
|
69
|
+
`route config "component" for path: ${String(
|
|
70
|
+
path || name
|
|
71
|
+
)} cannot be a ` + `string id. Use an actual component instead.`
|
|
72
|
+
)
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const pathToRegexpOptions: PathToRegexpOptions =
|
|
76
|
+
route.pathToRegexpOptions || {}
|
|
77
|
+
const normalizedPath = normalizePath(path, parent, pathToRegexpOptions.strict)
|
|
78
|
+
|
|
79
|
+
if (typeof route.caseSensitive === 'boolean') {
|
|
80
|
+
pathToRegexpOptions.sensitive = route.caseSensitive
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const record: RouteRecord = {
|
|
84
|
+
path: normalizedPath,
|
|
85
|
+
regex: compileRouteRegex(normalizedPath, pathToRegexpOptions),
|
|
86
|
+
components: route.components || { default: route.component },
|
|
87
|
+
instances: {},
|
|
88
|
+
name,
|
|
89
|
+
parent,
|
|
90
|
+
matchAs,
|
|
91
|
+
redirect: route.redirect,
|
|
92
|
+
beforeEnter: route.beforeEnter,
|
|
93
|
+
meta: route.meta || {},
|
|
94
|
+
props:
|
|
95
|
+
route.props == null
|
|
96
|
+
? {}
|
|
97
|
+
: route.components
|
|
98
|
+
? route.props
|
|
99
|
+
: { default: route.props }
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
if (route.children) {
|
|
103
|
+
// Warn if route is named, does not redirect and has a default child route.
|
|
104
|
+
// If users navigate to this route by name, the default child will
|
|
105
|
+
// not be rendered (GH Issue #629)
|
|
106
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
107
|
+
if (
|
|
108
|
+
route.name &&
|
|
109
|
+
!route.redirect &&
|
|
110
|
+
route.children.some(child => /^\/?$/.test(child.path))
|
|
111
|
+
) {
|
|
112
|
+
warn(
|
|
113
|
+
false,
|
|
114
|
+
`Named Route '${route.name}' has a default child route. ` +
|
|
115
|
+
`When navigating to this named route (:to="{name: '${
|
|
116
|
+
route.name
|
|
117
|
+
}'"), ` +
|
|
118
|
+
`the default child route will not be rendered. Remove the name from ` +
|
|
119
|
+
`this route and use the name of the default child route for named ` +
|
|
120
|
+
`links instead.`
|
|
121
|
+
)
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
route.children.forEach(child => {
|
|
125
|
+
const childMatchAs = matchAs
|
|
126
|
+
? cleanPath(`${matchAs}/${child.path}`)
|
|
127
|
+
: undefined
|
|
128
|
+
addRouteRecord(pathList, pathMap, nameMap, child, record, childMatchAs)
|
|
129
|
+
})
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (!pathMap[record.path]) {
|
|
133
|
+
pathList.push(record.path)
|
|
134
|
+
pathMap[record.path] = record
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (route.alias !== undefined) {
|
|
138
|
+
const aliases = Array.isArray(route.alias) ? route.alias : [route.alias]
|
|
139
|
+
for (let i = 0; i < aliases.length; ++i) {
|
|
140
|
+
const alias = aliases[i]
|
|
141
|
+
if (process.env.NODE_ENV !== 'production' && alias === path) {
|
|
142
|
+
warn(
|
|
143
|
+
false,
|
|
144
|
+
`Found an alias with the same value as the path: "${path}". You have to remove that alias. It will be ignored in development.`
|
|
145
|
+
)
|
|
146
|
+
// skip in dev to make it work
|
|
147
|
+
continue
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const aliasRoute = {
|
|
151
|
+
path: alias,
|
|
152
|
+
children: route.children
|
|
153
|
+
}
|
|
154
|
+
addRouteRecord(
|
|
155
|
+
pathList,
|
|
156
|
+
pathMap,
|
|
157
|
+
nameMap,
|
|
158
|
+
aliasRoute,
|
|
159
|
+
parent,
|
|
160
|
+
record.path || '/' // matchAs
|
|
161
|
+
)
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
if (name) {
|
|
166
|
+
if (!nameMap[name]) {
|
|
167
|
+
nameMap[name] = record
|
|
168
|
+
} else if (process.env.NODE_ENV !== 'production' && !matchAs) {
|
|
169
|
+
warn(
|
|
170
|
+
false,
|
|
171
|
+
`Duplicate named routes definition: ` +
|
|
172
|
+
`{ name: "${name}", path: "${record.path}" }`
|
|
173
|
+
)
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function compileRouteRegex (
|
|
179
|
+
path: string,
|
|
180
|
+
pathToRegexpOptions: PathToRegexpOptions
|
|
181
|
+
): RouteRegExp {
|
|
182
|
+
const regex = Regexp(path, [], pathToRegexpOptions)
|
|
183
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
184
|
+
const keys: any = Object.create(null)
|
|
185
|
+
regex.keys.forEach(key => {
|
|
186
|
+
warn(
|
|
187
|
+
!keys[key.name],
|
|
188
|
+
`Duplicate param keys in route with path: "${path}"`
|
|
189
|
+
)
|
|
190
|
+
keys[key.name] = true
|
|
191
|
+
})
|
|
192
|
+
}
|
|
193
|
+
return regex
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function normalizePath (
|
|
197
|
+
path: string,
|
|
198
|
+
parent?: RouteRecord,
|
|
199
|
+
strict?: boolean
|
|
200
|
+
): string {
|
|
201
|
+
if (!strict) path = path.replace(/\/$/, '')
|
|
202
|
+
if (path[0] === '/') return path
|
|
203
|
+
if (parent == null) return path
|
|
204
|
+
return cleanPath(`${parent.path}/${path}`)
|
|
205
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* @flow */
|
|
2
|
+
|
|
3
|
+
import type Router from '../index'
|
|
4
|
+
import { History } from './base'
|
|
5
|
+
import { NavigationDuplicated } from './errors'
|
|
6
|
+
import { isExtendedError } from '../util/warn'
|
|
7
|
+
|
|
8
|
+
export class AbstractHistory extends History {
|
|
9
|
+
index: number
|
|
10
|
+
stack: Array<Route>
|
|
11
|
+
|
|
12
|
+
constructor (router: Router, base: ?string) {
|
|
13
|
+
super(router, base)
|
|
14
|
+
this.stack = []
|
|
15
|
+
this.index = -1
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
push (location: RawLocation, onComplete?: Function, onAbort?: Function) {
|
|
19
|
+
this.transitionTo(
|
|
20
|
+
location,
|
|
21
|
+
route => {
|
|
22
|
+
this.stack = this.stack.slice(0, this.index + 1).concat(route)
|
|
23
|
+
this.index++
|
|
24
|
+
onComplete && onComplete(route)
|
|
25
|
+
},
|
|
26
|
+
onAbort
|
|
27
|
+
)
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
replace (location: RawLocation, onComplete?: Function, onAbort?: Function) {
|
|
31
|
+
this.transitionTo(
|
|
32
|
+
location,
|
|
33
|
+
route => {
|
|
34
|
+
this.stack = this.stack.slice(0, this.index).concat(route)
|
|
35
|
+
onComplete && onComplete(route)
|
|
36
|
+
},
|
|
37
|
+
onAbort
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
go (n: number) {
|
|
42
|
+
const targetIndex = this.index + n
|
|
43
|
+
if (targetIndex < 0 || targetIndex >= this.stack.length) {
|
|
44
|
+
return
|
|
45
|
+
}
|
|
46
|
+
const route = this.stack[targetIndex]
|
|
47
|
+
this.confirmTransition(
|
|
48
|
+
route,
|
|
49
|
+
() => {
|
|
50
|
+
this.index = targetIndex
|
|
51
|
+
this.updateRoute(route)
|
|
52
|
+
},
|
|
53
|
+
err => {
|
|
54
|
+
if (isExtendedError(NavigationDuplicated, err)) {
|
|
55
|
+
this.index = targetIndex
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
)
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
getCurrentLocation () {
|
|
62
|
+
const current = this.stack[this.stack.length - 1]
|
|
63
|
+
return current ? current.fullPath : '/'
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ensureURL () {
|
|
67
|
+
// noop
|
|
68
|
+
}
|
|
69
|
+
}
|