8000 test: update sample app for router v2 · AlexLingXiang/nativescript-vue@bce0623 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit bce0623

Browse files
committed
test: update sample app for router v2
1 parent 9fc5976 commit bce0623

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

samples/app/app-with-router-v2.js

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
const Vue = require('./nativescript-vue')
22
const VueRouter = require('vue-router')
3-
const application = require('tns-core-modules/application')
43

54
Vue.config.silent = false
65
Vue.config.debug = true
@@ -10,7 +9,9 @@ const Home = {
109
template: `
1110
<Page>
1211
<StackLayout>
13-
<Button text="Go to details page 1..." @tap="$router.push('/detail/1')"/>
12+
<Button text="Go to details page 1..." @tap="$router.push('/detail/1', {
13+
transition: 'slide'
14+
})"/>
1415
<Button text="Go to details page 2..." @tap="$router.push('/detail/2')"/>
1516
</StackLayout>
1617
</Page>
@@ -59,20 +60,11 @@ const router = new VueRouter({
5960

6061
router.push('/')
6162

62-
application.android &&
63-
application.android.on(
64-
application.AndroidApplication.activityBackPressedEvent,
65-
event => {
66-
event.cancel = true
67-
router.go(-1)
68-
}
69-
)
70-
7163
new Vue({
7264
router,
7365
template: `
7466
<GridLayout rows="*, 40">
75-
<Frame row="0">
67+
<Frame row="0" transition="fade">
7668
<router-view />
7769
</Frame>
7870

samples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
"dependencies": {
1616
"nativescript-gradient": "^2.0.1",
1717
"nativescript-pager": "^7.1.3",
18-
"nativescript-ui-sidedrawer": "^4.1.1",
1918
"nativescript-theme-core": "^1.0.4",
19+
"nativescript-ui-sidedrawer": "^4.1.1",
2020
"tns-core-modules": "4.0.0",
2121
"vue-router": "^3.0.1",
2222
"vuex": "^3.0.1"

0 commit comments

Comments
 (0)
0