This repository was archived by the owner on Jul 10, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Expand file tree Collapse file tree 4 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -125,9 +125,10 @@ module.exports = {
125125 middleware : 'check-auth' ,
126126
127127 extendRoutes ( routes : any , resolve : any ) {
128+ // https://ja.nuxtjs.org/api/configuration-router/#extendroutes
128129 if ( routers && routers . length > 0 ) {
129130 for ( let i = 0 , len = routers . length ; i < len ; i ++ ) {
130- routers [ i ] ( routes , resolve )
131+ routes . push ( routers [ i ] ( resolve ) )
131132 }
132133 }
133134 }
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 {
47 name : 'custom-path' ,
58 path : '/example/(c|d)-:a/(e|f)-:b/*' ,
69 component : resolve ( __dirname , '../../src/routed-pages/custom-path.vue' )
7- } )
10+ }
811}
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 {
37 name : 'include' ,
48 path : '/include' ,
59 component : resolve ( __dirname , '../../src/include/include.vue' )
6- } )
10+ }
711}
You can’t perform that action at this time.
0 commit comments