我在看material-ui的Drawer
组件的官方文档,发现了一个container
prop,不知道从哪里来的。它的 API 文档中没有提及。这是内置 React 组件的 Prop 之一吗?
下面是来自 material-ui 的响应式抽屉组件的屏幕截图:https://material-ui.com/components/drawers/#responsive-drawer
最佳答案
该 Prop 来自 Modal
Prop ,因为 Drawer
在 variant="temporary"
时包含来自 Modal
的 Prop >.
container - HTML element | func
An HTML element or function that returns one. The container will have the portal children appended to it. By default, it uses the body of the top-level document object, so it's simply document.
模态 Prop :https://material-ui.com/api/modal/
关于javascript - container prop在material-ui的Drawer组件中有什么作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/68790736/