mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-07 09:22:27 +00:00
Fix router generation for page names containing @/~
This commit is contained in:
parent
5f57166feb
commit
704e7cd7d9
@ -1,6 +1,6 @@
|
|||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import NuxtChild from './nuxt-child'
|
import NuxtChild from './nuxt-child'
|
||||||
import NuxtError from '<%= components.ErrorPage ? ((components.ErrorPage.includes('~') || components.ErrorPage.includes('@')) ? components.ErrorPage : "../" + components.ErrorPage) : "./nuxt-error.vue" %>'
|
import NuxtError from '<%= components.ErrorPage ? ((components.ErrorPage.indexOf('~') === 0 || components.ErrorPage.indexOf('@') === 0) ? components.ErrorPage : "../" + components.ErrorPage) : "./nuxt-error.vue" %>'
|
||||||
import { compile } from '../utils'
|
import { compile } from '../utils'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -118,7 +118,7 @@ export function r() {
|
|||||||
let args = Array.prototype.slice.apply(arguments)
|
let args = Array.prototype.slice.apply(arguments)
|
||||||
let lastArg = _.last(args)
|
let lastArg = _.last(args)
|
||||||
|
|
||||||
if (lastArg.includes('@') || lastArg.includes('~')) {
|
if (lastArg.indexOf('@') === 0 || lastArg.indexOf('~') === 0) {
|
||||||
return wp(lastArg)
|
return wp(lastArg)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,7 +133,7 @@ export function relativeTo() {
|
|||||||
let path = r(...args)
|
let path = r(...args)
|
||||||
|
|
||||||
// Check if path is an alias
|
// Check if path is an alias
|
||||||
if (path.includes('@') || path.includes('~')) {
|
if (path.indexOf('@') === 0 || path.indexOf('~') === 0) {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user