世界上最伟大的投资就是投资自己的教育

全场限时 5 折

首页React
XiaoMing · 金仙

我想在子组件里发请求调用服务端数据需要怎么操作啊,大神求帮忙。。。

XiaoMing发布于1951 次阅读

我想在子组件里发请求调用服务端数据需要怎么操作啊,大神求帮忙。。。

本站文章均为原创内容,如需转载请注明出处,谢谢。

4 条回复
  • 随风 · 练气
    随风 · 练气 #1

    发请求就是用 fetch 或 axios 呀

  • XiaoMing · 金仙
    XiaoMing · 金仙 #2

    我用的 antd 在子组件中用 dispatch 就出现 dispatch 未定义,在子组件上用了 @connect(),可以是可以用 dispatch ,不过浏览器报了。Warning: Invalid value for prop dispatch on

    tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://fb.me/react-attribute-behavior 报了这个错。
  • XiaoMing · 金仙
    XiaoMing · 金仙 #3

    找了 1 下午不知道什么问题。。

  • 随风 · 练气
    随风 · 练气 #4

    dispacth 你不知如何用的话,你应该看一下 dva 的内容或者 redux 的,这是属于它们的知识点,那里比较详细

喜欢
统计信息
    学员: 29063
    视频数量: 1973
    文章数量: 489

© 汕尾市求知科技有限公司 | Rails365 Gitlab | Qiuzhi99 Gitlab | 知乎 | b 站 | 搜索

粤公网安备 44152102000088号粤公网安备 44152102000088号 | 粤ICP备19038915号

Top