File tree 2 files changed +18
-7
lines changed
2 files changed +18
-7
lines changed Original file line number Diff line number Diff line change 1
- const Vue = require ( 'nativescript-vue /dist/index' )
1
+ const Vue = require ( '.. /dist/index' )
2
2
const http = require ( 'http' )
3
3
const Page = require ( 'ui/page' ) . Page
4
4
const StackLayout = require ( 'ui/layouts/stack-layout' ) . StackLayout
Original file line number Diff line number Diff line change @@ -57,18 +57,29 @@ router.replace('/foo')
57
57
new Vue ( {
58
58
router,
59
59
60
+ data : {
61
+ pageTitle : 'Current route: /foo'
62
+ } ,
63
+
60
64
template : `
61
- <page>
65
+ <page ref="page">
66
+ <action-bar :title="pageTitle"></action-bar>
62
67
<stack-layout>
63
- <stack-layout orientation="horizontal">
64
- <button @tap="$router.replace ('/foo')">Foo</button>
65
- <button @tap="$router.replace ('/bar')">Bar</button>
68
+ <stack-layout orientation="horizontal" horizontalAlignment="center" class="m-b-20" >
69
+ <button @tap="changeRoute ('/foo')" class="m-10 ">Foo</button>
70
+ <button @tap="changeRoute ('/bar')" class="m-10 ">Bar</button>
66
71
</stack-layout>
67
72
68
- <label style="text-align: center">Current route: {{ $route.fullPath }}</label>
69
-
70
73
<router-view></router-view>
71
74
</stack-layout>
72
75
</page>
73
76
` ,
77
+
78
+ methods : {
79
+ changeRoute ( to ) {
80
+ this . pageTitle = 'Current route: ' + to
81
+ router . replace ( to )
82
+ }
83
+ }
84
+
74
85
} ) . $start ( )
You can’t perform that action at this time.
0 commit comments