npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ivew-side-menu-search-chg

v1.0.5

Published

readme

Downloads

7

Readme

写在前面

最近在做的某系统,菜单非常多,系统本身业务比较多,再加上十好几张报表,导致整个菜单列表非常长, 用户在找的时候非常的不方便,于是便想着给菜单列表加上搜索功能,尽可能的将属性封装到组件了。

相关文章

关于该组件的一些Demo图片和实现思路和细节在我的博客上记载了,欢迎围观~

https://blog.csdn.net/lvdou1120101985/article/details/83447505

来自一枚大龄程序媛~

安装和使用

  1. 安装
install ivew-side-menu-search-chg --save
  1. 使用

最大的前提是项目本身使用的就是vue + iView

局部引入,父组件添加:

import SideMenu from 'ivew-side-menu-search-chg';

全局引入,在vue项目的入口js文件(一般是main.js)中添加:

import SideMenu from 'ivew-side-menu-search-chg';
Vue.use(SideMenu);

属性

| 属性 | 说明 | 类型 | 参数 | 默认值 | | ---- | ---- | ---- | ---- | ---- | | menuList | 菜单列表数据 | Array | | 空 | | collapsed | 菜单是否折叠 | Boolean| | false | | theme | 主题 | String| | 'light' | | collapsed | 菜单是否折叠 | Boolean| | false | | rootIconSize | 折叠之后的一级菜单按钮大小 | Number| | 20 | | iconSize | 折叠之后二级等菜单按钮大小 | Number| | 16 | | accordion | 是否开启手风琴模式 | Boolean| | true |

menuList示例,必须具有以下格式,参数必须包含以下所示:

 [
    {
      name: '采购审核',
      menuIcon: ' iconfont icon-fenlei',
      url: '/check',
      children: [
        {
          name: '采购订单',
          menuIcon: ' iconfont icon-fenlei',
          url: '/check/po-list', // 二级菜单的url要在一级菜单上添加
        }
      ]
    },
    {

    }
  ]

为了点击菜单项可以跳转路由,路由需要一下格式:

{
    path: '/set/role',
    name: '/set/role'
}

即path和name的值一样,因为,点击菜单项的时候: router.push({name: url}); 所以路由要设置url和name的值一样。