简体   繁体   English

Office-UI-Fabric-React:如何替换 CommandBar 菜单中的“ChevronDown”和“ChevronRight”图标?

[英]Office-UI-Fabric-React: How to replace the icons "ChevronDown" and "ChevronRight" in a CommandBar menu?

Please have a look at the following demo: https://codesandbox.io/s/sharp-bell-u9e3s请看下面的演示: https : //codesandbox.io/s/sharp-bell-u9e3s

You see a simple CommandBar example where at "Submenu 1.2" the normal icon "ChevronRight" is replaced by the icon "Forward".您会看到一个简单的 CommandBar 示例,其中在“Submenu 1.2”中,普通图标“ChevronRight”被图标“Forward”替换。 The other icon at top level should also be replace => instead of "ChevronDown" the icon called "Down" shall be used.顶层的另一个图标也应该替换 => 而不是“ChevronDown”,应该使用名为“Down”的图标。 How is this possible???这怎么可能???

PS: Of course, in real world I want those icons to be replaced by totally different open-source license icons, but I wanted the demo to be as simple as possible. PS:当然,在现实世界中,我希望这些图标被完全不同的开源许可证图标替换,但我希望演示尽可能简单。 BTW: Function "registerIcons" is not an option for me.顺便说一句:功能“registerIcons”对我来说不是一个选项。

Each commandbar item is a button.每个命令栏项目都是一个按钮。 Button's take menuIconProps.按钮采用 menuIconProps。

        key: "1.0",
        name: "Menu 1",
        menuIconProps: {
            iconName: 'Add'
        },

Check out the icon component for other ways to customize:https://developer.microsoft.com/en-us/fabric#/controls/web/icon查看图标组件以了解其他自定义方式:https ://developer.microsoft.com/en-us/fabric#/controls/web/icon

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将office-ui-fabric-react安装到现有的MVC项目中? - How to install office-ui-fabric-react into an existing MVC project? office-ui-fabric-react / TextField 输入属性替代 onChanged - office-ui-fabric-react / TextField input properties alternative to onChanged 如何使用 Office UI Fabric React 在 CommandBar 菜单中显示喙? - How to show beaks in CommandBar menus with Office UI Fabric React? 在Office UI Fabric React CommandBar中使用SearchBox - Using the SearchBox in Office UI Fabric React CommandBar 如何在 office-ui-fabric-react 中的下拉组件上获取选定的值? - How to get selected value on Dropdown component in office-ui-fabric-react? office-ui-fabric-react:如何将主题的默认字体更改为较小 - office-ui-fabric-react: How to change a theme's default font to be smaller 连接的反应路由器和Office-ui-fabric-react <Nav> - connected-react-router and office-ui-fabric-react <Nav> office-ui-fabric-react:loadTheme更改全局CSS? - office-ui-fabric-react: loadTheme to change global CSS? OfficeDev / office-ui-fabric-react - ChoiceGroup 组件 - OfficeDev / office-ui-fabric-react - ChoiceGroup component 无法处理 office-ui-fabric-react 中 ChoiceGroup 的内部元素(使用 onRenderField 显示)的更改/单击 - Not able to handle change/click on inner elements (displyed using onRenderField) of ChoiceGroup in office-ui-fabric-react
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM