baidu / san

A fast, portable, flexible JavaScript component framework
https://baidu.github.io/san/
MIT License
4.72k stars 549 forks source link

san是怎么请求接口获取数据来渲染的? #692

Closed fei686868 closed 2 years ago

fei686868 commented 2 years ago

如题,请大神能否给个示例

另外有没有san的交流QQ群呢

zhengmz commented 2 years ago

看文档 https://baidu.github.io/san/

fei686868 commented 2 years ago

看文档 https://baidu.github.io/san/

文档看了好几遍了,没找到啊

errorrik commented 2 years ago

通常在组件的某个生命周期钩子里发送请求,请求回来后设置数据。比如 attached

如果你用了 router,可能使用 route 钩子。比如 https://github.com/ecomfe/san-realworld-app/blob/master/src/article/view.js#L37