从rest api填充Vue模板组件中的表格 [英] Populate table in Vue template component from rest api

查看:24
本文介绍了从rest api填充Vue模板组件中的表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 Vue 组件,我试图在其中获取 rest api(使用 axios)数据来填充表.其余调用在 chrome 中返回一个有效的 json 字符串.但是,我无法让它填充模板中的表格.当我运行视图时,我在 rest 调用中收到以下错误:

<块引用>

类型错误:无法设置未定义的属性课程"

这是返回的json:

<块引用>

[{"CourseId":"architecture","AuthorId":"cory-house","Title":"ArchitectingApplications","CourseLength":"4:20","Category":"软件架构测试"}]

这是我的模板: