d2-crud-plus icon indicating copy to clipboard operation
d2-crud-plus copied to clipboard

报错 data is undefined

Open uGoodiwell opened this issue 3 years ago • 11 comments

你好我是刚开始用 d2-curd-plus 使用的真实接口后,浏览器报错 data is undefined 能请求到后端的数据 不知道为什么表格不显示数据

uGoodiwell avatar May 12 '21 10:05 uGoodiwell

先看文档: https://greper.gitee.io/d2-crud-plus/guide/structure.html

greper avatar May 12 '21 10:05 greper

图片 我调了返回格式,还是不行

uGoodiwell avatar May 12 '21 12:05 uGoodiwell

https://greper.gitee.io/d2-crud-plus/guide/quickstart.html#_4-%E4%BF%AE%E6%94%B9http%E5%93%8D%E5%BA%94%E6%8B%A6%E6%88%AA%E7%9A%84%E8%BF%94%E5%9B%9E%E7%BB%93%E6%9E%9C

greper avatar May 12 '21 12:05 greper

看这一章节:修改http响应拦截的返回结果

greper avatar May 12 '21 12:05 greper

调整了后端返回得数据结构, 现在报错 ret is undefined #浏览器错误 图片

main中代码

图片 请求代码 图片

uGoodiwell avatar May 13 '21 11:05 uGoodiwell

返回的数据格式

图片

uGoodiwell avatar May 13 '21 11:05 uGoodiwell

image

greper avatar May 14 '21 00:05 greper

我添加了return 图片 现在浏览器报[Vue warn]: Invalid prop: type check failed for prop "data". Expected Array, got Undefined

这是我得mian.js 图片 这是浏览器控制台 图片

uGoodiwell avatar May 14 '21 02:05 uGoodiwell

你页面代码怎么写的?

greper avatar May 14 '21 04:05 greper

我的前端框架是dvadmin, 这是index.vue 图片 这是crud.js 图片 api.js 用的原生axios 图片 返回的数据结构 图片

uGoodiwell avatar May 14 '21 04:05 uGoodiwell

搞忘记了,还需要帮你看吗?你可以加我好友

greper avatar May 21 '21 01:05 greper