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

ct-adc-tree

v2.0.0-alpha.4

Published

A Vue.js project

Downloads

7

Readme

ct-adc-tree

使用element中tree组件的相关代码,对某些功能进行了修复优化后的产物。

组件示例图

img

在线demo

在线demo

功能点

除了tree控件,另封装了area-tree

使用

从npm安装ct-adc-test

npm install ct-adc-tree --save

在代码中使用

import {tree, areaTree} from 'ct-adc-tree';

Vue.component(tree.name,tree);
Vue.component(areaTree.name, areaTree);

或

new Vue({
    ...
    components:{
        'tree': tree,
        'area-tree': areaTree
      }
    ...
})

props

参数 | 说明 | 类型 | 默认值 | 可选值 | 描述 | --- | --- | --- | --- | ---- | --- sep | 地区分隔符 | String | '-' selected | 需要选中的地区 | String | Array | []

selected格式

支持字符串: 以',|,'分隔单个地区的字符串如'浙江-杭州,江苏'或'0601,04')

支持数组: 如['浙江-杭州','江苏']或['0601','04']

支持JSON字符串: 如["0601"]或["浙江-杭州"],请勿误用['0601']、['浙江-杭州']等非法JSON,会导致结果非预期

方法

getChecked

获取选中的地区

参数列表

参数 | 说明 | 类型 | 默认值 | 可选值 | 描述 | --- | --- | --- | --- | ---- | ---- readable | 获取的结果是否为地区中文名称 | Boolean | false | true/false | 默认为中文,否则为地区编码

返回值

类型: {Array}

说明: 遵循最简原则,数据只到达第一个全选的节点。

["浙江","安徽","福建","江西-南昌","江西-赣州-章贡区"]

setChecked

设置需要选中的地区,接收一个参数,Array 或者 String/JSON String

参数列表

参数 | 说明 | 类型 | 默认值 | 可选值 | 描述 | --- | --- | --- | --- | ---- | ---- areaList | 初始选中的地区 | Array/String/JSON String | [] | | 地区名称列表

参数形如:["浙江","安徽","福建","江西-南昌","江西-赣州-章贡区"]或"浙江,安徽,福建,江西-南昌,江西-赣州-章贡区"

如上,会选中浙江省、安徽省、福建省、江西省南昌市、江西省赣州市章贡区

返回值

undefined

事件

事件1

事件名称 | 说明 | 回调参数 | 描述 change | 选中内容发生改变时触发 | 当前选中的地区 ({name:[...], id: [...]})|

更新日志

更新日志

外部资源依赖列表

  • area 1.0.0+