Skip to content

Commit 14a34bc

Browse files
msaelicesrigor789
authored andcommitted
chore(samples): add sample app for nativescript-vue#555 (nativescript-vue#590)
1 parent 838d98a commit 14a34bc

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

samples/app/555.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const Vue = require('nativescript-vue')
2+
3+
Vue.config.debug = true
4+
Vue.config.silent = false
5+
6+
new Vue({
7+
data: {
8+
foo: false
9+
},
10+
template: `
11+
<Frame>
12+
<Page>
13+
<ActionBar title="Issue #555" />
14+
15+
<StackLayout>
16+
<Label text="You should see now a greeting dialog" />
17+
</StackLayout>
18+
</Page>
19+
</Frame>
20+
`,
21+
mounted() {
22+
// this dialog is not shown because when the Vue mounted event
23+
// is fired NS has not loaded all the UI components yet
24+
// so for being able to use it change the <Page> tag to:
25+
// <Page @loaded="greet"> instead of using the mounted event
26+
this.greet()
27+
},
28+
methods: {
29+
greet() {
30+
alert('Hello!').then(() => {
31+
console.log('Alert dialog closed.')
32+
})
33+
}
34+
}
35+
}).$start()

0 commit comments

Comments
 (0)