我在使用vue的以下代码时遇到麻烦,它导致网站打印多个“测试” /无限循环,但它只能打印2次。
关于这个问题有什么建议吗?顺便说一下,我对vue很陌生,所以请忍受我。
JavaScript文件
var rs = [
{
"id": 1,
"name": "xxxx",
"description": "Description",
"address": "vvvvv",
"image": "img-src"
},
{
"id": 2,
"name": "yyyyyy",
"description": "Description",
"address": "qqqqqqqq",
"image": "img-src"
} ];
var restaurant_list = new Vue({
el: '#restaurant_list',
data: {
restaurants: rs
}
})
HTML文件
<div class="container" id="restaurant_list">
<div v-for="restaurant in restaurants">
<label>test</label>
</div>
</div>