Skip to content

Commit a0959e6

Browse files
committed
feat: path.relative
1 parent 1f86e97 commit a0959e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/router/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ const views = []
1010
const vueFiles = require.context('@/views', true, /page\.vue$/)
1111
vueFiles.keys().forEach(key => {
1212
const component = vueFiles(key).default
13-
const routePath = path.dirname(component.__source).replace(/^src\/views\//, '')
13+
const routePath = path.relative('src/views', path.dirname(component.__source))
1414
const routeName = routePath.replace(path.sep, '-')
1515
views.push({
1616
name: routeName,

0 commit comments

Comments
 (0)