File tree Expand file tree Collapse file tree 2 files changed +24
-4
lines changed
generator/templates/simple/src Expand file tree Collapse file tree 2 files changed +24
-4
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,14 @@ import Navigator from 'nativescript-vue-navigator'
1818import App from './App.vue';
1919import { options } from './router';
2020
21- Vue.use(Navigator, { routes : options . routes } )
21+ const routes = options.routes.reduce((data, route) => {
22+ data [ route . name ] = {
23+ component : route . component
24+ }
25+ return data
26+ } , { } );
27+
28+ Vue.use(Navigator, { routes } );
2229< % # END_REPLACE % >
2330
2431< % # REPLACE % >
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ replace:
55 - ! ! js / regexp / import Router from 'vue-router' /
66 - ! ! js / regexp / Vue . use \(Router \)/
77 - ! ! js / regexp / export default new Router \(\{/
8- - ! ! js / regexp / import Home from './views/Home.vue' /
9- - ! ! js / regexp / './views/About.vue' \)/
8+ - ! ! js / regexp / import Home from '\./views/Home.vue' /
9+ - ! ! js / regexp / \(\) => import ( . * ) \.\/views \/About \.vue '\)/
10+ - ! ! js / regexp / ( \s+ ) \/\/ ( . * ) /
11+ - ! ! js / regexp / ( \s+ ) \/\/ ( . * ) /
12+ - ! ! js / regexp / ( \s+ ) \/\/ ( . * ) /
1013 - ! ! js / regexp / \}\)/
1114-- -
1215
@@ -28,10 +31,20 @@ export const options = {
2831
2932< % # REPLACE % >
3033import Home from '~ / views / Home . vue ';
34+ import About from '~ / views / About . vue ';
35+ < % # END_REPLACE % >
36+
37+ < % # REPLACE % >
38+ About ,
39+ < % # END_REPLACE % >
40+
41+ < % # REPLACE % >
42+ < % # END_REPLACE % >
43+
44+ < % # REPLACE % >
3145< % # END_REPLACE % >
3246
3347< % # REPLACE % >
34- '~/views/About.vue'),
3548< % # END_REPLACE % >
3649
3750< % # REPLACE % >
You can’t perform that action at this time.
0 commit comments