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

qjkj-tree

v0.0.1

Published

适用于 Vue 3 和 TypeScript 的 tree 包装组件

Downloads

6

Readme

qjkj-tree   1.1

适用于 Vue 3 和 TypeScript 的 tree 包装组件

特点

  1. 支持 Vue 3 和 TypeScript;
  2. 零插件;
  3. 虚拟树,计算更新视图内节点;

安装

npm i qjkj-tree

用法

<template>
  <tree :data="data">
    <template v-slot:nodeHeader="{ row }">
      <!-- {{ row.leve }} -->
    </template>
  </tree>

  <dragTree :data="data" :draggable="true"/>
</template>

<script setup>
  import { ref } from 'vue';
  import { tree, dragTree } from 'qjkj-tree';

  const data = ref([
	{
		id: '1',
		label: '一级 1',
		children: [
			{
				id: '1-1',
				label: '二级 1-1',
				children: [
					{
						id: '1-1-1',
						label: '三级 1-1-1',
					},
				],
			},
		],
	},
	{
		id: '2',
		label: '一级 2',
		children: [
			{
				id: '2-1',
				label: '二级 2-1',
				children: [
					{
						id: '2-1-1',
						label: '三级 2-1-1',
					},
				],
			},
			{
				id: '2-2',
				label: '二级 2-2',
				children: [
					{
						id: '2-2-1',
						label: '三级 2-2-1',
					},
				],
			},
		],
	},
	{
		id: '3',
		label: '一级 3',
		children: [
			{
				id: '3-1',
				label: '二级 3-1',
				children: [
					{
						id: '3-1-1',
						label: '三级 3-1-1',
					},
				],
			},
			{
				id: '3-2',
				label: '二级 3-2',
				children: [
					{
						id: '3-2-1',
						label: '三级 3-2-1',
					},
				],
			},
		],
	},
	{
		id: '4',
		label: '一级 4',
		children: [
			{
				id: '4-1',
				label: '二级 4-1',
				children: [
					{
						id: '4-1-1',
						label: '三级 4-1-1',
					},
				],
			},
			{
				id: '4-2',
				label: '二级 4-2',
				children: [
					{
						id: '4-2-1',
						label: '三级 4-2-1',
					},
				],
			},
		],
	},
]);
</script>

props

|名称|类型|默认值|响应性|说明| |-|-|-|-|-| |data|Array |[ ]|✅|tree数据| |draggable|boolean|false||设置节点可拖拽 | |nodeSize|number|30||节点高度,用于计算视图展示节点数量| |props|object|{ children: 'children', label: 'label' }||配置选项| |nodeKey|string |id||每个树节点用来作为唯一标识的属性,整棵树应该是唯一的| |defaultExpandAll|boolean|false||是否默认展开所有节点 |

插槽

|插槽名|说明| |-|-| |nodeHeader|树节点的label前插入内容, 自定义树节点的内容, 参数为 { row }|