File tree Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Expand file tree Collapse file tree 2 files changed +26
-6
lines changed Original file line number Diff line number Diff line change @@ -4,23 +4,43 @@ Vue.config.debug = true
4
4
Vue . config . silent = false
5
5
6
6
new Vue ( {
7
- data : {
8
- labelCondition : false
7
+ data ( ) {
8
+ return {
9
+ labelCondition : false ,
10
+ selectedDate : new Date ( )
11
+ }
9
12
} ,
10
13
template : `
11
14
<Frame>
12
15
<Page>
13
16
<ActionBar title="App with all components" />
14
17
15
- <StackLayout>
16
- <Label v-if="labelCondition" text="Enable" @tap="labelCondition = false"/>
17
- <Label v-if="!labelCondition" text="Disable" @tap="labelCondition = true"/>
18
+ <StackLayout class="m-t-20">
19
+ <Label
20
+ v-if="labelCondition"
21
+ text="Label with labelCondition enabled. Tap me to disable"
22
+ textWrap
23
+ @tap="labelCondition = false"/>
18
24
25
+ <Label
26
+ v-if="!labelCondition"
27
+ text="Label with labelCondition disabled. Tap me to enable"
28
+ @tap="labelCondition = true"
29
+ textWrap />
30
+
31
+ <DatePicker
32
+ v-model="selectedDate"
33
+ @dateChange="onDateChanged" />
19
34
</StackLayout>
20
35
</Page>
21
36
</Frame>
22
37
` ,
23
38
created ( ) {
24
39
console . log ( Vue . compile ( this . $options . template ) . render . toString ( ) )
40
+ } ,
41
+ methods : {
42
+ onDateChanged ( ) {
43
+ console . log ( `Date changed to ${ this . selectedDate } ` )
44
+ }
25
45
}
26
46
} ) . $start ( )
Original file line number Diff line number Diff line change 1
1
{
2
- "main" : " app-with-frames .js" ,
2
+ "main" : " app-with-all-components .js" ,
3
3
"name" : " nativescript-template-tutorial" ,
4
4
"version" : " 1.0.1"
5
5
}
You can’t perform that action at this time.
0 commit comments