我是 vuejs 的新手,正在尝试使用 buefy 库。
错误 :
道具无效:道具“数据”的类型检查失败。预期数组,得到对象
<template>
<b-table :data="data" :columns="columns"></b-table>
</template>
<script>
export default {
data() {
return {
data: this.data,
columns: [
{
field: 'name',
label: 'Name',
},
]
}
},
mounted() {
axios
.get('/test')
.then(
response => (this.data = response)
)
}
}
</script>
json 内容:
[{"name":"test"}]
我错过了什么?谢谢 :)
原文由 Thomazzi 发布,翻译遵循 CC BY-SA 4.0 许可协议
知道了!
谢谢 :)