# lhy-menu

> A project named test1

Latest version **1.0.4** (published 2020-07-23) · ISC license · 0 weekly downloads

## Install

```sh
npm install lhy-menu
pnpm add lhy-menu
yarn add lhy-menu
bun add lhy-menu
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; large bundle.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2020-07-23 |
| First published | 2020-07-22 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 128.3 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | luhaiyung |

## Links

- npm: https://www.npmjs.com/package/lhy-menu
- Repository: https://github.com/LienJack/vue-template-cli
- Homepage: https://github.com/LienJack/vue-template-cli#readme
- Issues: https://github.com/LienJack/vue-template-cli/issues
- npm.io page: https://npm.io/package/lhy-menu

## Dependencies (11)

- [vue](https://npm.io/package/vue.md) ^2.6.10
- [vuex](https://npm.io/package/vuex.md) ^3.1.1
- [axios](https://npm.io/package/axios.md) ^0.19.0
- [core-js](https://npm.io/package/core-js.md) ^2.6.9
- [js-cookie](https://npm.io/package/js-cookie.md) ^2.2.0
- [vue-router](https://npm.io/package/vue-router.md) ^3.0.7
- [@babel/polyfill](https://npm.io/package/@babel/polyfill.md) ^7.4.4
- [@i61/element-ui](https://npm.io/package/@i61/element-ui.md) ^1.0.43
- [throttle-debounce](https://npm.io/package/throttle-debounce.md) 1.1.0
- [@i61/common-webpack](https://npm.io/package/@i61/common-webpack.md) ^2.0.0
- [@babel/runtime-corejs2](https://npm.io/package/@babel/runtime-corejs2.md) ^7.5.4

## Recent versions

- 1.0.4 (latest) — 2020-07-23
- 1.0.3 — 2020-07-23
- 1.0.2 — 2020-07-23
- 1.0.1 — 2020-07-23
- 1.0.0 — 2020-07-22

## README

# 可收缩树形菜单
## 导入方法
进入项目：
```javascript
npm install lhy-menu@1.0.4  --registry=https://registry.npmjs.org/
```
main.js中：
```javascript
import {LhyMenu} from 'lhy-menu'
Vue.use(LhyMenu)
```
## 基础用法
```

<LhyMenu :list="list" ref="menu" ></LhyMenu>
<button @click="handleSelctAll">全选</button>
<button @click="handleCancelAll">全不选</button>
<button @click="getCheckedNodes">获取选中菜单</button>
<script>
import {LhyMenu} from 'lhy-menu'
export default {
  name:'index',
  data() {
    return {
      msg: 'Hello,welcome to use 61tpl',
      list: [
        {
          title: '父级1',
          name: 'menu1',
          children: [
            {
              title: '1-1',
              name: 'menu1-1',
            },
          ],
        },
        {
          title: '父级2',
          name: 'menu2',
          children: [
            {
              title: '2-1',
              name: 'menu2-1',
              children: [
                {
                  title: '2-1-1',
                  name: 'menu2-1-1',
                  children: [
                    {
                      title: '2-1-1-1',
                      name: 'menu2-1-1-1',
                    },
                    {
                      title: '2-1-1-2',
                      name: 'menu2-1-1-2',
                    },
                    {
                      title: '2-1-1-3',
                      name: 'menu2-1-1-3',
                    },
                  ],
                },
              ],
            },
          ],
        },
        {
          title: '父级3',
          name: 'menu3',
          children: [
            {
              title: '3-1',
              name: 'menu3-1',
              children: [
                {
                  title: '3-1-1',
                  name: 'menu3-1-1'
                },
                {
                  title: '3-1-2',
                  name: 'menu3-1-2'
                },
                {
                  title: '3-1-3',
                  name: 'menu3-1-3'
                },
              ],
            },
          ],
        },
        {
          title: '父级4',
          name: 'menu4'
        },
      ],
    }
  },
  components:{
    LhyMenu
  },
  methods:{
    handleSelctAll(){
      this.$refs.menu.selectAll('true')
    },
    handleCancelAll(){
      this.$refs.menu.selectAll('false')
    },
    getCheckedNodes(){
      this.checkedNodes = this.$refs.menu.getCheckedNodes();
      console.log(this.checkedNodes)
    }
  }
}
</script>

```

## 参数
|  参数|说明 |可选|默认|
|--|--|--|--|
|list  | 展示数据 |-|-

## 方法
|  方法名|说明 |参数|
|--|--|--|
|selectAll  | 对节点进行操作，选中所有节点或取消所有选中节点 |(isSelectAll)接收一个String类型参数，选中所有节点：'true'，取消所有选中：'false'。|
|getCheckedNodes|返回一个数组，元素为选中的节点的name值|-

---
_Source: https://npm.io/package/lhy-menu · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
