React如何从后端获取数据并渲染到前端

React如何从后端获取数据并渲染到前端


饮歌长啸
浏览 562回答 3
3回答

POPMUISE

actions:export const getMenu = () => { return async (dispatch) => { let msg = await fetch('data/nodes',{method: 'POST', //body: JSON.stringify({"aa":"aa"}),header: {'content-type':'application/json; charset=utf-8'}}).then((res)=>res.json()); var state = { nodes: msg };dispatch({ type: 'INIT',state});};}
打开App,查看更多内容
随时随地看视频慕课网APP