Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 30a11bf

Browse files
committed
fix: fix nested components in v-template
fixes nativescript-vue#107
1 parent f032200 commit 30a11bf

File tree

2 files changed

+33
-1
lines changed

2 files changed

+33
-1
lines changed

platform/nativescript/util/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,11 @@ export function after(original, thisArg, wrap) {
7676

7777
export function deepProxy(object, depth = 0) {
7878
return new Proxy(object, {
79-
get() {
79+
get(target, key) {
80+
if (key === 'toString') {
81+
return () => ''
82+
}
83+
8084
if (depth > 10) {
8185
throw new Error('deepProxy over 10 deep.')
8286
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
const Vue = require('./nativescript-vue')
2+
3+
Vue.component('comment', {
4+
props: ['comment'],
5+
template: `<label :text="comment.content"/>`
6+
})
7+
new Vue({
8+
data: {
9+
comments: [
10+
{ content: 'hello1' },
11+
{ content: 'hello2' },
12+
{ content: 'hello3' },
13+
{ content: 'hello4' }
14+
]
15+
},
16+
template: `
17+
<page class="page">
18+
<action-bar title="Home" class="action-bar"></action-bar>
19+
<stack-layout class="home-panel">
20+
<list-view for="comment in comments">
21+
<v-template>
22+
<comment :comment="comment"/>
23+
</v-template>
24+
</list-view>
25+
</stack-layout>
26+
</page>
27+
`
28+
}).$start()

0 commit comments

Comments
 (0)