react怎么一次渲染多個(gè)組件
2 回答

慕虎7371278
TA貢獻(xiàn)1802條經(jīng)驗(yàn) 獲得超4個(gè)贊
1、把組件import進(jìn)來
1 2 3 | import { MyComponent1 } from 'components/MyComponent1 ' import { MyComponent2 } from 'components/MyComponent2 ' import { MyComponent3 } from 'components/MyComponent3 ' |
2、render方法調(diào)用組件
1 2 3 4 5 6 7 | render() { <div> <MyComponent1 /> <MyComponent2 /> <MyComponent3 /> </div> } |
- 2 回答
- 0 關(guān)注
- 1674 瀏覽
添加回答
舉報(bào)
0/150
提交
取消