Skip to content

Commit ce39a38

Browse files
committed
Test case for the nativescript-vue#272 issue
1 parent 79059bf commit ce39a38

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

samples/app/272.js

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
const Vue = require('./nativescript-vue')
2+
3+
Vue.config.debug = true
4+
Vue.config.silent = false
5+
6+
class User {
7+
constructor(name) {
8+
this.name = name.toUpperCase()
9+
}
10+
}
11+
12+
new Vue({
13+
template: `
14+
<Frame>
15+
<Page class="page">
16+
<ActionBar title="Issue #272" class="action-bar" />
17+
<StackLayout>
18+
<ListView
19+
for="user in userList">
20+
<v-template>
21+
<StackLayout>
22+
<Label
23+
:text="user.name"
24+
@tap="onTap" />
25+
</StackLayout>
26+
</v-template>
27+
</ListView>
28+
</StackLayout>
29+
</Page>
30+
</Frame>
31+
`,
32+
data() {
33+
return {
34+
userList: [new User('John'), new User('Paul')]
35+
}
36+
},
37+
methods: {
38+
onTap({ object }) {
39+
console.log(`Tapped on ${object.text}`)
40+
}
41+
}
42+
}).$start()

0 commit comments

Comments
 (0)