@@ -24,12 +24,11 @@ export default class VueCrudGenerator {
24
24
this . registerTemplate ( templatePath , 'api/fooFetch.js' ) ;
25
25
26
26
// components
27
- this . registerTemplate ( templatePath , 'components/foo/Create.js' ) ;
28
- this . registerTemplate ( templatePath , 'components/foo/Form.js' ) ;
29
- this . registerTemplate ( templatePath , 'components/foo/index.js' ) ;
30
- this . registerTemplate ( templatePath , 'components/foo/List.js' ) ;
31
- this . registerTemplate ( templatePath , 'components/foo/Update.js' ) ;
32
- this . registerTemplate ( templatePath , 'components/foo/Show.js' ) ;
27
+ this . registerTemplate ( templatePath , 'components/foo/Create.vue' ) ;
28
+ this . registerTemplate ( templatePath , 'components/foo/Form.vue' ) ;
29
+ this . registerTemplate ( templatePath , 'components/foo/List.vue' ) ;
30
+ this . registerTemplate ( templatePath , 'components/foo/Update.vue' ) ;
31
+ this . registerTemplate ( templatePath , 'components/foo/Show.vue' ) ;
33
32
34
33
// routes
35
34
this . registerTemplate ( templatePath , 'routes/foo.js' ) ;
@@ -55,18 +54,23 @@ export default class VueCrudGenerator {
55
54
import ${ titleLc } Routes from './routes/${ titleLc } ';
56
55
57
56
// Add the modules in the store
58
- import foo from './store/modules/foo ';
57
+ import { ${ titleLc } from './store/modules/{ ${ titleLc } / ';
59
58
60
59
export const store = new Vuex.Store({
61
60
// ...
62
61
modules: {
63
- foo
62
+ { ${ titleLc }
64
63
}
65
64
});
66
65
67
66
68
- // Add routes to <Switch>
69
- { ${ titleLc } Routes }
67
+ // Add routes to VueRouter
68
+ const router = new VueRouter({
69
+ // ...
70
+ routes: [
71
+ ...{ ${ titleLc } Routes },
72
+ ]
73
+ });
70
74
` ) ) ;
71
75
}
72
76
@@ -107,12 +111,11 @@ export const store = new Vuex.Store({
107
111
this . createFile ( 'api/fooFetch.js' , `${ dir } /api/${ lc } Fetch.js` , context ) ;
108
112
109
113
// components
110
- this . createFile ( 'components/foo/Create.js' , `${ dir } /components/${ lc } /Create.js` , context ) ;
111
- this . createFile ( 'components/foo/Form.js' , `${ dir } /components/${ lc } /Form.js` , context ) ;
112
- this . createFile ( 'components/foo/index.js' , `${ dir } /components/${ lc } /index.js` , context ) ;
113
- this . createFile ( 'components/foo/List.js' , `${ dir } /components/${ lc } /List.js` , context ) ;
114
- this . createFile ( 'components/foo/Update.js' , `${ dir } /components/${ lc } /Update.js` , context ) ;
115
- this . createFile ( 'components/foo/Show.js' , `${ dir } /components/${ lc } /Show.js` , context ) ;
114
+ this . createFile ( 'components/foo/Create.vue' , `${ dir } /components/${ lc } /Create.vue` , context ) ;
115
+ this . createFile ( 'components/foo/Form.vue' , `${ dir } /components/${ lc } /Form.vue` , context ) ;
116
+ this . createFile ( 'components/foo/List.vue' , `${ dir } /components/${ lc } /List.vue` , context ) ;
117
+ this . createFile ( 'components/foo/Update.vue' , `${ dir } /components/${ lc } /Update.vue` , context ) ;
118
+ this . createFile ( 'components/foo/Show.vue' , `${ dir } /components/${ lc } /Show.vue` , context ) ;
116
119
117
120
// routes
118
121
this . createFile ( 'routes/foo.js' , `${ dir } /routes/${ lc } .js` , context )
0 commit comments