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 🙏

© 2026 – Pkg Stats / Ryan Hefner

one-tree-ui

v1.1.1

Published

多功能树,js tree

Readme

one-tree 一个树

前言 该树设计的初衷是为统一树的逻辑和样式。以一个树的渲染为基座,树的样式为插件的形式来呈现出不同的树

详细文档地址

Demo

安装

npm install one-tree-ui

html

<div id="app"></div>

引用

//type-3指的是类型
import 'one-tree-ui/dist/index.css' 
import 'one-tree-ui/dist/plugin/type-3/index.css'
import oneTree from 'one-tree-ui' 
import type3 from 'one-tree-ui/dist/plugin/type-3'

example

const Tree = new oneTree({
    container:'app',
    type:type3,
})
let demo = [
    {
        name:'一级菜单',
        children:[
            {
                name:'1-1菜单',
                id:'12',
            },
            {
                name:'1-2菜单',
                children:[
                    {
                        name:'1-2-1菜单'
                    }
                ]
            },
            {
                name:'1-3菜单'
            },
        ]
    },
    {
        name:'一级菜单2',
        children:[
            {
                name:'2-1菜单'
            },
            {
                name:'2-2菜单'
            },
        ]
    },
    {
        name:'一级菜单3'
    },
]
Tree.init({
    list:demo,//数据
    style:{//样式
        liHeight:40,//一行菜单高度,单位px
        paddingLeft:24//左侧缩进,单位px
    }
});
Tree.event('choose',function(res){
    console.log(res)
})

Tree.setActive('12')//手动设置选中

License (MIT)