簡體   English   中英

透明可滑動抽屜材質-UI

[英]Transparent Swipeable drawer Material-UI

我需要知道如何從Material UI將“透明”樣式的背景應用於我的SwipeableDrawer組件...由於該組件在呈現時在html文件中創建了另一個組件,因此我無法從代碼中更改其背景。 我試圖放一些,但似乎該組件不喜歡它。

提前致謝。

如Material-ui Docs中所述,您可以使用ModalProps覆蓋Modal的樣式。 使用ModalBackdropProps ,您可以將背景設置為透明。

創建一個styles變量並應用必要的樣式。

 const styles = { BackdropProps: { background: 'transparent' } }; 

使用classes屬性將樣式應用於Backdrop的根

 <SwipeableDrawer ModalProps={{ BackdropProps:{ classes:{ root:classes.BackdropProps } } }} {...otherProps}> 

看看文檔中具有類的重寫組件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM