File tree 1 file changed +3
-4
lines changed
1 file changed +3
-4
lines changed Original file line number Diff line number Diff line change @@ -199,19 +199,18 @@ export function search(query) {
199
199
export function init ( config , vm ) {
200
200
const isAuto = config . paths === 'auto' ;
201
201
const paths = isAuto ? getAllPaths ( vm . router ) : config . paths ;
202
-
203
202
let namespaceSuffix = '' ;
204
203
205
204
// only in auto mode
206
- if ( isAuto && config . pathNamespaces ) {
205
+ if ( paths . length && isAuto && config . pathNamespaces ) {
207
206
const path = paths [ 0 ] ;
208
207
209
208
if ( Array . isArray ( config . pathNamespaces ) ) {
210
209
namespaceSuffix =
211
- config . pathNamespaces . find ( prefix => path && path . startsWith ( prefix ) ) ||
210
+ config . pathNamespaces . find ( prefix => path . startsWith ( prefix ) ) ||
212
211
namespaceSuffix ;
213
212
} else if ( config . pathNamespaces instanceof RegExp ) {
214
- const matches = path && path . match ( config . pathNamespaces ) ;
213
+ const matches = path . match ( config . pathNamespaces ) ;
215
214
216
215
if ( matches ) {
217
216
namespaceSuffix = matches [ 0 ] ;
You can’t perform that action at this time.
0 commit comments