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'
18
18
import App from './App.vue';
19
19
import { options } from './router';
20
20
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 } );
22
29
< % # END_REPLACE % >
23
30
24
31
< % # REPLACE % >
Original file line number Diff line number Diff line change @@ -5,8 +5,11 @@ replace:
5
5
- ! ! js / regexp / import Router from 'vue-router' /
6
6
- ! ! js / regexp / Vue . use \(Router \)/
7
7
- ! ! 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+ ) \/\/ ( . * ) /
10
13
- ! ! js / regexp / \}\)/
11
14
-- -
12
15
@@ -28,10 +31,20 @@ export const options = {
28
31
29
32
< % # REPLACE % >
30
33
import 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 % >
31
45
< % # END_REPLACE % >
32
46
33
47
< % # REPLACE % >
34
- '~/views/About.vue'),
35
48
< % # END_REPLACE % >
36
49
37
50
< % # REPLACE % >
You can’t perform that action at this time.
0 commit comments