This repository was archived by the owner on Jul 10, 2019. It is now read-only.
File tree 4 files changed +24
-8
lines changed
4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,10 @@ module.exports = {
125
125
middleware : 'check-auth' ,
126
126
127
127
extendRoutes ( routes : any , resolve : any ) {
128
+ // https://ja.nuxtjs.org/api/configuration-router/#extendroutes
128
129
if ( routers && routers . length > 0 ) {
129
130
for ( let i = 0 , len = routers . length ; i < len ; i ++ ) {
130
- routers [ i ] ( routes , resolve )
131
+ routes . push ( routers [ i ] ( resolve ) )
131
132
}
132
133
}
133
134
}
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Nuxt の route インターフェイス
3
+ */
4
+ export default interface INuxtRoute {
5
+ name : string
6
+ path : string
7
+ component : string
8
+ }
Original file line number Diff line number Diff line change 1
- export default function ( routes : any , resolve : any ) : void {
2
- // https://ja.nuxtjs.org/api/configuration-router/#extendroutes
3
- routes . push ( {
1
+ import INuxtRoute from '../interface/INuxtRoute'
2
+
3
+ export default function (
4
+ resolve : ( dirname : string , routeDir : string ) => string
5
+ ) : INuxtRoute {
6
+ return {
4
7
name : 'custom-path' ,
5
8
path : '/example/(c|d)-:a/(e|f)-:b/*' ,
6
9
component : resolve ( __dirname , '../../src/routed-pages/custom-path.vue' )
7
- } )
10
+ }
8
11
}
Original file line number Diff line number Diff line change 1
- export default function ( routes : any , resolve : any ) : void {
2
- routes . push ( {
1
+ import INuxtRoute from '../interface/INuxtRoute'
2
+
3
+ export default function (
4
+ resolve : ( dirname : string , routeDir : string ) => string
5
+ ) : INuxtRoute {
6
+ return {
3
7
name : 'include' ,
4
8
path : '/include' ,
5
9
component : resolve ( __dirname , '../../src/include/include.vue' )
6
- } )
10
+ }
7
11
}
You can’t perform that action at this time.
0 commit comments