Skip to content

Commit f3033a3

Browse files
committed
feat (wrap ns components): Add DatePicker component to the app-with-all-components app
1 parent 76a222a commit f3033a3

File tree

2 files changed

+26
-6
lines changed

2 files changed

+26
-6
lines changed

samples/app/app-with-all-components.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,43 @@ Vue.config.debug = true
44
Vue.config.silent = false
55

66
new Vue({
7-
data: {
8-
labelCondition: false
7+
data() {
8+
return {
9+
labelCondition: false,
10+
selectedDate: new Date()
11+
}
912
},
1013
template: `
1114
<Frame>
1215
<Page>
1316
<ActionBar title="App with all components" />
1417
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"/>
1824
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" />
1934
</StackLayout>
2035
</Page>
2136
</Frame>
2237
`,
2338
created() {
2439
console.log(Vue.compile(this.$options.template).render.toString())
40+
},
41+
methods: {
42+
onDateChanged() {
43+
console.log(`Date changed to ${this.selectedDate}`)
44+
}
2545
}
2646
}).$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-frames.js",
2+
"main": "app-with-all-components.js",
33
"name": "nativescript-template-tutorial",
44
"version": "1.0.1"
55
}

0 commit comments

Comments
 (0)