async asyncData () { const asyncData1 = {}; let rows = await this.getsyn(); asyncData1.myitems = rows asyncData1.haha = 'haha1' asyncData1.project = 'haha2' console.log(rows) return asyncData1; }, mounted(){ console.log('row --------') //console.log(this.row) //this.getItems(); }, methods:{ async getsyn(){ let rows = await api.get('/api/list.json?page=1&time='+new Date().getTime() ,{}); return rows; }, }
<div v-for="item in myitems">
/
最终解决版
其他不变---
index.vue
async asyncData () { const asyncData = {}; let rows = await api.get('http://localhost:15009/list.json?page=1&time='+new Date().getTime() ,{}); let rowsStr = JSON.stringify(rows) asyncData.myRow = rowsStr return asyncData; },