# feielement

> 1.选中某个指定类型的节点，传入不选中的节点数组 中的节点 不选中。（前提是选中节点的子孙节点中），其祖先节点全部选中。 2.取消选中某个节点，其子孙节点全部取消选中，祖先节点不发生任何变化。

Latest version **1.0.4** (published 2022-11-06) · ISC license · 0 weekly downloads

## Install

```sh
npm install feielement
pnpm add feielement
yarn add feielement
bun add feielement
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2022-11-06 |
| First published | 2022-10-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 391.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | wang_fei |

## Links

- npm: https://www.npmjs.com/package/feielement
- npm.io page: https://npm.io/package/feielement

## Recent versions

- 1.0.4 (latest) — 2022-11-06
- 1.0.3 — 2022-11-06
- 1.0.1 — 2022-10-30
- 1.0.0 — 2022-10-30

## README

### 实现功能
1.选中某个指定类型的节点，传入不选中的节点数组 中的节点 不选中。（前提是选中节点的子孙节点中），其祖先节点全部选中。
2.取消选中某个节点，其子孙节点全部取消选中，祖先节点不发生任何变化。

```
<FeiTreeSelect :treeData="data" v-if="data.length" :unCheckedSubNodesType="[2,3]" @getSelectKeys="getSelectKeys"></FeiTreeSelect>
getSelectKeys(val) {
  console.log('data', val);
}
```
```
// 数据格式
// 节点需要有nodeId, parentNodeId,用于遍历树，需要有nodeType,用于区分节点类型,后代节点使用children：[]
export const treeData = [
  {
    nodeId: 1,
    nodeType: 1,
    label: '一级1',
    parentNodeId: 0,
    children: [
      {
        nodeId: 11,
        nodeType: 1,
        label: '二级1-1',
        parentNodeId: 1,
        children: [
          {
            nodeId: 111,
            nodeType: 1,
            label: '三级1-1-1',
            parentNodeId: 11,
            children: [
              {
                nodeId: 1111,
                nodeType: 1,
                label: '四级1-1-1-1',
                parentNodeId: 111,
              }
            ]
          },
          {
            nodeId: 112,
            nodeType: 2,
            label: '三级1-1-2（2类型）',
            parentNodeId: 11,
          }
        ]
      },
      {
        nodeId: 12,
        nodeType: 1,
        label: '二级1-2',
        parentNodeId: 1,
        children: [
          {
            nodeId: 121,
            nodeType: 2,
            label: '二级1-2-1（2类型）',
            parentNodeId: 12,
          }
        ]
      },
      {
        nodeId: 13,
        nodeType: 3,
        label: '二级1-3（3类型）',
        parentNodeId: 1,
        children: [
          
        ]
      }
    ]
  },
  {
    nodeId: 2,
    nodeType: 1,
    label: '一级2',
    parentNodeId: 0,
    children: [
      {
        nodeId: 21,
        nodeType: 1,
        label: '二级2-1',
        parentNodeId: 2,
      },
      {
        nodeId: 22,
        nodeType: 1,
        label: '二级2-2',
        parentNodeId: 2,
        children: [
          {
            nodeId: 221,
            nodeType: 1,
            label: '三级2-2-1',
            parentNodeId: 22,
          },
          {
            nodeId: 222,
            nodeType: 1,
            label: '三级2-2-2',
            parentNodeId: 22,
          },
          {
            nodeId: 223,
            nodeType: 1,
            label: '三级2-2-3',
            parentNodeId: 22,
            children: [
              {
                nodeId: 2231,
                nodeType: 1,
                label: '四级2-2-3-1',
                parentNodeId: 223,
              },
              {
                nodeId: 2232,
                nodeType: 1,
                label: '四级2-2-3-2',
                parentNodeId: 223,
              }
            ]
          }
        ]
      },
      {
        nodeId: 23,
        nodeType: 1,
        label: '二级2-3',
        parentNodeId: 2,
      }
    ]
  }
  
]
```

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