alitajs / alita

A React framework based on umi.
https://alitajs.com
MIT License
793 stars 85 forks source link

tabsLayout在自定义layout中能否控制rootContainer节点的值 #407

Closed panghaoyuan closed 1 year ago

panghaoyuan commented 2 years ago

问题

在使用自定义layout时,tablayout直接挂载在root节点下。导致样式出现问题 image

antd pro自带的layout挂载节点

image

自定义layout挂载节点

image

xiaohuoni commented 1 year ago

自定义 layout 用 useKeepOutlets 代替 useOutlets 即可,不要使用 presets 参考 https://github.com/alitajs/alita/blob/05398892d5da0338c018fb8920650e48b3529e7d/examples/pro/src/app.tsx#L102