用nuxt asyncData
Posted cnchengv
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用nuxt asyncData相关的知识,希望对你有一定的参考价值。
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">
以上是关于用nuxt asyncData的主要内容,如果未能解决你的问题,请参考以下文章