File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
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 ( )
You can’t perform that action at this time.
0 commit comments