react怎么一次渲染多個組件
2 回答

慕虎7371278
TA貢獻1802條經驗 獲得超4個贊
1、把組件import進來
1 2 3 | import { MyComponent1 } from 'components/MyComponent1 ' import { MyComponent2 } from 'components/MyComponent2 ' import { MyComponent3 } from 'components/MyComponent3 ' |
2、render方法調用組件
1 2 3 4 5 6 7 | render() { <div> <MyComponent1 /> <MyComponent2 /> <MyComponent3 /> </div> } |
- 2 回答
- 0 關注
- 1654 瀏覽
添加回答
舉報
0/150
提交
取消