使用 Menubar 組件,在縮小瀏覽器視窗時會自動顯示漢堡選單。但是,單擊該按鈕后,我想將圖示從 pi-bars 更改為 pi-times。有沒有辦法做到這一點?
我什至不確定如何訪問代碼中的按鈕。https://www.primefaces.org/primevue/#/menubar上的示例也沒有解釋它。
uj5u.com熱心網友回復:
一種方法是使用 CSS。.p-menubar-mobile-active當移動模式選單打開時,選單會應用該類,并且圖示 ( <i>) 是.p-menubar-button. 將圖示的::before內容更改為\e90b,即 的字符代碼pi-times:
<style>
.p-menubar.p-menubar-mobile-active .p-menubar-button i::before {
content: "\e90b"; /* pi-times icon */
}
</style>
演示
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/446211.html
上一篇:型別不可分配給型別'IntrinsicAttributes&{children?:ReactNode;}'。財產
