@yizhou-library/main-template-tree-icon-layout
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

图标树主导航

@ewell/mainTemplateTreeIconLayout 图标树主导航,可收缩展开

dependencies 为发布依赖包集合

:::dependencies { "dependencies": { "@types/react": "16.9.2", "@types/react-dom": "16.9.0", "react": "^16.9.0", "react-dom": "^16.9.0", "@yizhou-library/core": "latest", "@yizhou-library/icons": "latest", }, "devDependencies": { } } :::dependencies

版本匹配

antd@3.26.15 时,则 @types/react-slick@0.23.4 不生成 @types/react-slick/node_modules/@types/react@16.9.2

│ ├─┬ @types/react-slick@0.23.4
│ │ └── @types/react@16.9.2 deduped 没有找到

本地开发 - loginToken\ activeWardCode\ siderCode

http://galaxyw.ewell.com:8082/?loginToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1OTA3OTUwOTgsInVzZXJuYW1lIjoiVDk1MjcifQ.ZA2WcUnuUvg_8NgxtmrMBsh5icytjoaxdU7bArZ3S50&activeWardCode=12000302&siderCode=HL_HLZD_WDZZGL

代码演示

Menu.Item 的 key 在 MENUS_DATA 的 menuType===‘3’的时候取 appList 下的 appCode,其他的取 menuId; 在路由中配置 siderCode 参数能指定左侧菜单选中项,如果是二级或三级菜单选中需要把父级的 key 带入,用逗号割开

// render

:::

API

参数 说明 类型 可选值 默认值
env 指定环境变量参数 String dev,sit,uat,prod,mock prod
bar 是否展示顶部或左侧菜单 Array header,menu ['header','menu']
menuData 左侧菜单数据 MenuData[] - -
basename 未设置,则路由全部使用 router 跳转(即,无<a 标签导航;RouterContainer 的 basename 属性也需要同步移除) String - -
userInfo 用户信息 UserInfo{} - -
renderHeader 渲染顶部其他信息 ReactNode - -
showCollapsed 是否显示展开收起图标 boolean - true
websit 站点信息 Websit{} - -
theme 主题 string default,darkblue default

MenuData

interface MenuData {
  name: string;
  img: string;
  selectImg?: string;
  url?: string;
  children?: MenuData[];
}

UserInfo

actionList[可选]:右侧用户信息下拉,默认显示退出登录,退出登录功能(质控)已实现,自定义退出登录时 code 设置为”logout“可覆盖默认的退出登录;有[onSelect]函数是执行[onSelect],否则跳转[url]

interface UserInfo {
  id: string;
  name: string;
  actionList?: {
    name: string;
    code: string;
    url?: string;
    onSelect?: (item) => void;
  };
}

Websit

interface Websit {
  name?: string; // 顶部左上角系统名
  logo?: string;
}

Package Sidebar

Install

npm i @yizhou-library/main-template-tree-icon-layout

Weekly Downloads

0

Version

0.0.4

License

MIT

Unpacked Size

253 kB

Total Files

75

Last publish

Collaborators

  • xiweixiong
  • yzkj