小编Put*_*tta的帖子

突出显示导航窗格中的选定项目

参考https://developer.microsoft.com/en-us/fabric#/controls/web/nav下的示例“带有嵌套链接的导航” ,单击导航项时,我想突出显示该项目。我已将 url 设置为“ ”,这样单击某个项目不会执行任何操作。但是,我希望该项目在单击时突出显示。我该怎么做呢?任何指示都会有帮助。

import * as React from 'react';
import { Nav,INavStyles } from 'office-ui-fabric-react/lib/Nav';
import { initializeIcons } from '@uifabric/icons';
initializeIcons();

    const navStyles: INavStyles = {
  root:{
      boxSizing: 'border-box',
      border: '1px solid lightgrey',
      overflowY: 'auto',
      height: 300
  },
  chevronButton: {
      height: 30
  },
  chevronIcon:{
      height: 30,
      lineHeight: 30
  },
  compositeLink: {}, 
  group:{}, 
  groupContent: {},
  link: {},
  linkText:{},
  navItem:{}, 
  navItems:{
    margin: 0
  },
};

export const NavNestedExample1: React.FunctionComponent = () => {
  return (
    <Nav
      styles={navStyles}
      ariaLabel="Nav …
Run Code Online (Sandbox Code Playgroud)

reactjs office-ui-fabric react-tsx

3
推荐指数
1
解决办法
1713
查看次数

标签 统计

office-ui-fabric ×1

react-tsx ×1

reactjs ×1