vue从后端拿到数据,如何将其渲染到前端呢?我用this变量接收,但又自动转成了proxy,咋整?
showBooks: function () {
axios.get('http://127.0.0.1:8000/api/show_books').then( (res)=>{
let result = JSON.parse(JSON.stringify(res.data.list))
this.bookList = result
console.log(result)
console.log(this.bookList)
})
}
<template>
class="home">
row>查询 row>
row>
table :data="bookList" height="250" style="width: 100%">
table-column prop="" label="PrimaryKey" width="180" />
table-column prop="date" label="Date" width="180" />
table-column prop="name" label="Name" width="180" />
table-column prop="address" label="Address" />
table>
row>
template>
那就直接赋值booklist