在 office-ui react 结构中,我如何克服 chevon 图标 https://developer.microsoft.com/en-us/fabric#/components/nav
在文档中有这个接口
INavStyles
但我无法用我自己的图标覆盖它。我想用FolderHorizontal和OpenFolderHorizontal图标替换现有的 V 形图标
import { AppContainer } from 'react-hot-loader';
import * as React from "react";
import * as ReactDOM from "react-dom";
import { Nav, INavProps } from 'office-ui-fabric-react/lib/Nav';
import { initializeIcons } from 'office-ui-fabric-react/lib/Icons';
initializeIcons(/* optional base url */);
....
....
public _getNavLink(): any[] {
return [
{
name: 'Home',
url: '',
links: [{
name: 'Activity',
url: '',
key: 'key1'
},
{
name: 'News',
url: '',
key: 'key2'
}],
isExpanded: true
}
]}
public render() {
return (
<div>
<Nav
getStyles={() => {
return {
chevronIcon: {
color: 'transparent',
transform: 'rotate(0)',
selectors: {
'&:before': {
color: 'rgb(51, 51, 51)',
fontFamily: "FabricMDL2Icons-7",
content: '"\\F12B"',
},
'.is-expanded > * > &:before': {
fontFamily: "FabricMDL2Icons-5",
content: '"\\ED25"',
}
}
}
}
}}
groups={
[
{
links: this._getNavLink()
}
]
}
expandedStateText={ 'expanded' }
collapsedStateText={ 'collapsed' }
selectedKey={ 'key3' }
/>
</div>
);
}