【问题标题】:How to change Material-UI Dialog Html location如何更改 Material-UI 对话框 Html 位置
【发布时间】:2021-03-09 09:24:11
【问题描述】:

如何更改位置?还是别无选择?

<div role="presentation" class="MuiDialog-root" style="position: fixed; z-index: 1300; inset: 0px;">

我想把它放进去:

<div id="root" class="flex" aria-hidden="true">

我想要结果:

<div id="root" class="flex" aria-hidden="true">
   <div role="presentation" class="MuiDialog-root" style="position: fixed; z- 
   index: 1300; inset: 0px;">
   </div>
</div>

【问题讨论】:

    标签: html reactjs user-interface


    【解决方案1】:

    您需要创建样式并通过 classes 属性传递它,它在此处的文档中有所提及:https://material-ui.com/api/dialog/,并且此线程中有一个示例说明如何执行此操作:How to change the position of material-ui's dialog?

    【讨论】:

    • 对不起,我的意思是,我想把整个HTML语法放在指定的地方。
    • 对不起,我的内容已经更新,让需求更清晰
    • 根据文档,您必须通过 classes 属性才能更改添加的初始 css。您可以在从文档中提取和简化的示例中看到我在此处传递的道具:codesandbox.io/s/ex-tnzfz?file=/demo.js
    猜你喜欢
    • 1970-01-01
    • 2012-11-13
    • 2017-03-27
    • 1970-01-01
    • 2012-09-15
    • 2011-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多