【发布时间】:2019-09-02 14:03:34
【问题描述】:
我想显示 Observable Array 中的文本,但它总是显示 [object Object]。
我尝试从 https://docs.nativescript.org/vuejs/ns-ui/ListView/getting-started 复制和粘贴示例,但它仍然显示 [object Object]
这是我的代码,类似于上面 URL 中的示例:
<template>
<page>
<StackLayout>
<RadListView ref="listView" for="item in itemList" height="50%">
<v-template>
<StackLayout>
<Label :text="item.name"/>
<StackLayout>
</v-template>
</RadListView>
</StackLayout>
</page>
</template>
<script>
import { ObservableArray } from 'tns-core-modules/data/observable-array';
export default {
data() {
return {
itemList: new ObservableArray([
{name: 'Item 1', description: 'Item 1 description'},
{name: 'Item 2', description: 'Item 2 description'},
{name: 'Item 3', description: 'Item 3 description'},
]),
};
},
methods: {
}
};
</script>
我希望标签显示 Observable Array 值
【问题讨论】:
-
我无法重现这个问题,你能分享一个 Playground 示例吗?
-
这里是网址
https://play.nativescript.org/?template=play-vue&id=beIZRg&v=1@Manoj
标签: android vue.js nativescript