quasar ajax用法,vue.js - Quasar q-table not rendering data from AJAX - Stack Overflow

这篇博客讲述了作者在使用Quasar框架时遇到的问题,即尝试用Q-Table组件显示从API获取的数据,但数据未能正确显示。尽管在Ajax调用中成功接收到数据,却无法将其填充到Q-Table中。作者寻求帮助,希望找到可能的解决方案。
摘要由CSDN通过智能技术生成

title="posts"

dense

:data="posts"

:columns="columns"

row-key="name"

>

import { api } from 'boot/axios'

export default {

name: 'PageIndex',

data () {

return {

columns: [

{

name: 'id',

label: 'the id',

field: 'id',

align: 'left',

sortable: true

}

],

posts: []

}

},

methods: {

getPosts () {

api.get('https://jsonplaceholder.typicode.com/posts')

.then(response => {

this.posts = response.data

console.log(this.posts)

})

.catch(error =>{

console.log(error)

})

}

},

mounted () {

this.getPosts()

}

}

I'm starting up with quasar framework and trying to get a simple q-table that gets populated from an ajax call. I don't see any errors (which would have been helpful) but data is not showing up. Is there something I'm missing here. Any pointers would help.

Also, I see the data coming back from the ajax call. But data is not making it to the q-table.

Best,

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值