New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

fancy-select2

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fancy-select2

a vue tree-select component

latest
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

fancy-select

一个基于 vue 的高性能树形选择组件

特点

  • 提供树形结构的单选和多选
  • 子节点懒加载
  • 支持键盘事件
  • 自定义树节点
  • 上万条数据流畅展示

安装

npm 安装

npm install --save fancy-select2

script 引入

<script src="https://unpkg.com/fancy-select2"></script>

使用

npm引入

import组件

import FancySelect from "fancy-select2";

在组件中引入

components: {
  FancySelect;
}

引入样式文件

import "fancy-select2/dist/fancy-select2.min.css";

script标签引入

引入样式文件

<link
  rel="stylesheet"
  href="https://unpkg.com/fancy-select2@0.2.2/dist/fancy-select2.min.css"
/>

注册组件

Vue.component("fancy-select2", FancySelect.default);

基本使用

<fancy-select :tree-data="options"></fancy-select>

组件属性

参数说明类型可选值默认值
treeData原始数据Arraynull
label数据中用于展示的字段名称Stringlabel
multiple是否用于多选Booleantrue/falsetrue
maxHeight下拉菜单的最大高度Number300
matchKeys搜索的匹配字段数组['label']
includeValue选中树型数据时,可以选择只返回父节点、子节点、、所有节点包括半选状态的节点、所有节点不包括半选状态StringPARENT/LEAF/ALL/ALL_WITH_INDETERMINATEPARENT
noResultsText搜索无匹配数据的提示信息String暂无数据
loadOptions异步加载函数Function
noChildrenText无子节点提示信息String暂无子节点
value初始值,如果需要双向绑定,则直接使用v-modelArraynull
placeholderplaceholderString请选择数据...
limit限制选中的值的显示个数NumberInfinity
limitText超过limit值后,显示的内容Functionfunction limitTextDefault(count) {return + ${count}}
normalizer指定数据的id,children,label字段Functionfunction(node){return{id:node.id,label:node.label,children:node.children}}
defaultExpandLevel默认展开的层级Number0

FAQs

Package last updated on 26 May 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts