【发布时间】:2021-02-17 03:12:51
【问题描述】:
我试图使用 axios 获取数据,然后将结果显示到 vue 中的数据表 (jQuery) 中。它显示没有可用的数据。 脚本
async mounted(){
axios.get("https://www.reddit.com/r/technology/new.json")
.then( (res) => {
this.tableData = res.data.data.children;
console.log(this.tableData);
$(document).ready(function(){
$('.myDataTable').DataTable();
});
});
【问题讨论】:
-
console.log(res) 返回什么?
-
@Catmal 嘿,它从上面的链接返回json数据
-
上面没有链接..
标签: jquery vue.js asynchronous datatable async-await