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

iview-select-tree

v1.0.13

Published

基于iview的下拉菜单树的实现

Downloads

82

Readme

iview-select-tree

基于iview进行二次开发的级联树状选择组件,支持无限级,单选,多选,搜索,表单验证(注:使用前先引入iview,否则无法使用)

安装

npm install iview-select-tree --save

引入

import selectTree from 'iview-select-tree'

在引入的vue模块中需要在components上注册这个组件,这样才可以正常使用这个组件:

export default {
  name: 'app',
  components:{
    selectTree
  },
  data () {
     return {
        ...
     }
  },
  ...
}

效果

多选效果

avatar

单选效果

avatar

表单验证效果

avatar

调用方式

<selectTree  v-model="val" :treeData="data"></selectTree>

参数说明

| 属性 | 说明 | 类型 | 默认 | 版本 | | :-----| ---- | :----: | :----: | :----: | | filterable | 是否支持搜索 | Boolean | false | 1.0.6 | | clearable | 是否可以清空选项,只在单选时有效 | Boolean | false | 1.0.6 | | treeData | 下拉树的数据 | Array | 空 | 1.0.6 | | multiple | 是否允许多选 | Boolean | false | 1.0.6 | | value | 指定选中项目的 value 值,可以使用 v-model 双向绑定数据。单选时只接受 String 或 Number,多选时只接受 Array | String 或 Number 或 Array | 空 | 1.0.6 | | showQuery | 是否展示下拉的搜索框 | true | 1.0.8 | | disabled | 是否禁用或启用当前的下拉框 | true | 1.0.10 |

方法说明

| 方法 | 说明 | 返回值 | | :-----| ---- | :----: | | on-select-change | 下拉框选中的时候触发的事件 | hideVal,showVal |

treeData的数据格式

{
	"title": "parent 1",
	"expand": true,
	"value": "1",
	"children": [{
		"title": "k 1-1",
		"expand": true,
		"value": "11",
		"children": [{
			"value": "111",
			"title": "leaf 1-1-1",
			"expand": true
		}]
	}]
}

demo说明的例子

iview下拉菜单树的iview-select-tree的使用

github

如果觉得写的可以就给一个star吧,如果那里有bug大家可以直接提issue https://github.com/lazyboyl/iview-select-tree

版本更新

1.0.13

  • 修复部分反馈的BUG
  • 支持view-design-4.7版本

1.0.12

  • 【BUG】修复无法下载问题

1.0.11

  • 【BUG】修复加载的数据无法回显的问题

1.0.10

  • 【新增】新增由@GyPsyEyes提出的#issues4的disabled禁用和启用的需求场景。

1.0.9

  • 【新增】新增由@zhangjiwei14提出的#issues3的需求场景。