我正在学习如何使用 Vue-Resource,并且我正在使用我正在使用的 api 碰壁。我正在尝试使用v-for: thread in threads
.
这是我正在使用的示例:
[{
"threads": [{
"no": 1,
"name": "John",
"com": "comment"
},{
"no": 2,
"name": "Jim",
"com": "comment"
},{
"no": 3,
"name": "Jane",
"com": "comment"
}],
"page": 0
}, {
"threads": [{
"no": 4,
"name": "Tom",
"com": "comment"
},{
"no": 5,
"name": "Mark",
"com": "comment"
}],
"page": 1
}]
该 api 在几页上列出了线程,我想要的是一个看起来像{{ thread.name }}{{ thread.com }}
每个页面的列表,no
但我并不完全清楚如何使用 vue-resource 获取该信息。目前,如果我使用
<li v-for="thread in threads"> {{ thread.name }}{{ thread.com }} </li>
我只是得到一个空项目列表。