Skip to content

Commit ebe19c0

Browse files
committed
chore: update samples to 5.3
1 parent 595d2a0 commit ebe19c0

File tree

5 files changed

+80
-35
lines changed

5 files changed

+80
-35
lines changed

platform/nativescript/runtime/components/frame.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import { setFrame, getFrame, deleteFrame } from '../../util/frame'
22
import { isHMRChecking, resetHMRChecking } from '../../util/hmr'
33
import { isAndroid, isIOS } from 'tns-core-modules/platform'
44
import { ios as iosUtils } from 'tns-core-modules/utils/utils'
5-
import { _setAndroidFragmentTransitions } from 'tns-core-modules/ui/frame/fragment.transitions'
65

76
let idCounter = 1
87

samples/app/app-with-frame.js

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,32 @@
11
const Vue = require('./nativescript-vue')
2+
const VueDevtools = require('nativescript-vue-devtools')
3+
4+
Vue.use(VueDevtools)
25

36
Vue.config.silent = false
47
Vue.config.debug = true
58

6-
const createPage = title =>
7-
new Vue({
8-
template: `<Page><Foo/></Page>`,
9-
components: {
10-
Foo: {
11-
template: `<Label text="${title}"/>`,
12-
created() {
13-
this.intv = setInterval(
14-
() => console.log(`[${title}] INTERVAL FIRED.`),
15-
1000
16-
)
17-
},
18-
destroyed() {
19-
clearInterval(this.intv)
20-
}
9+
const createPage = title => ({
10+
template: `<Page><Foo/></Page>`,
11+
components: {
12+
Foo: {
13+
template: `<Label text="${title}"/>`,
14+
created() {
15+
this.intv = setInterval(
16+
() => console.log(`[${title}] INTERVAL FIRED.`),
17+
1000
18+
)
19+
},
20+
destroyed() {
21+
clearInterval(this.intv)
2122
}
2223
}
23-
}).$mount().$el.nativeView
24+
}
25+
})
2426

2527
new Vue({
2628
template: `
27-
<Frame ref="frame"
28-
@navigated="log('navigated')"
29+
<Frame @navigated="log('navigated')"
2930
@navigatedBack="log('navigatedBack')"
3031
>
3132
<Page><Button text="Page" @tap="navigate" /></Page>
@@ -34,11 +35,7 @@ new Vue({
3435

3536
methods: {
3637
navigate() {
37-
this.$refs.frame.navigate({
38-
create() {
39-
return createPage('test')
40-
}
41-
})
38+
this.$navigateTo(createPage('test'))
4239
},
4340
log(name) {
4441
console.log('FRAME EVENT: ' + name)
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
const Vue = require('./nativescript-vue')
2+
const VueDevtools = require('nativescript-vue-devtools')
3+
4+
Vue.use(VueDevtools)
5+
6+
Vue.config.silent = false
7+
Vue.config.debug = true
8+
9+
let id = 1
10+
11+
const page = name => ({
12+
template: `
13+
<Page actionBarHidden="true">
14+
<GridLayout>
15+
<Label text="${name}" />
16+
</GridLayout>
17+
</Page>
18+
`
19+
})
20+
21+
new Vue({
22+
template: `
23+
<GridLayout rows="auto, *">
24+
<GridLayout row="0" columns="auto, *, auto" padding="10" background="#191E38" color="#ffffff">
25+
<Label col="0" text="<<<" @tap="backward"/>
26+
<Label col="1" text="Title" marginLeft="20" />
27+
<Label col="2" text=">>>" @tap="forward" />
28+
</GridLayout>
29+
30+
<ContentView row="1">
31+
<Frame>
32+
<HomePage />
33+
</Frame>
34+
</ContentView>
35+
</GridLayout>
36+
`,
37+
methods: {
38+
forward() {
39+
this.$navigateTo(page('OtherPage ID:' + id++))
40+
},
41+
42+
backward() {
43+
this.$navigateBack()
44+
}
45+
},
46+
components: {
47+
HomePage: page('Home')
48+
}
49+
}).$start()

samples/app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"main": "app-with-all-components.js",
2+
"main": "app-with-shared-actionbar.js",
33
"name": "nativescript-template-tutorial",
44
"version": "1.0.1"
55
}

samples/package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@
44
"readme": "NativeScriptVue Samples Application",
55
"nativescript": {
66
"id": "org.nativescript.application",
7-
"tns-ios": {
8-
"version": "4.2.0"
9-
},
107
"tns-android": {
11-
"version": "4.2.0"
8+
"version": "5.3.0"
9+
},
10+
"tns-ios": {
11+
"version": "5.3.0"
1212
}
1313
},
1414
"dependencies": {
15-
"@vue/devtools": "^5.0.0-beta.3",
16-
"nativescript-pager": "^8.0.2",
17-
"nativescript-socket.io": "^0.9.0",
15+
"@vue/devtools": "^5.0.6",
16+
"nativescript-pager": "^9.4.0",
17+
"nativescript-socketio": "^3.2.1",
1818
"nativescript-theme-core": "^1.0.4",
19-
"nativescript-toast": "^1.4.6",
19+
"nativescript-toasty": "^1.3.0",
2020
"nativescript-ui-gauge": "^3.7.1",
2121
"nativescript-ui-sidedrawer": "^4.3.0",
2222
"nativescript-vue-devtools": "^1.1.0",
23-
"tns-core-modules": "^4.2.0",
23+
"tns-core-modules": "^5.3.1",
2424
"vue-router": "^3.0.1",
2525
"vuex": "^3.0.1"
2626
}
27-
}
27+
}

0 commit comments

Comments
 (0)