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

@xn-lib/component

v0.1.3

Published

基于 Element Plus 的 Vue 3 企业级组件库,提供完整的 TypeScript 类型支持。

Downloads

817

Readme

@xn-lib/component

基于 Element Plus 的 Vue 3 企业级组件库,提供完整的 TypeScript 类型支持。

npm version license

✨ 特性

  • 🎯 TypeScript 支持 - 完整的类型定义,自动生成类型声明
  • 🧩 企业级组件 - 基于 Element Plus 二次封装
  • ⚡️ Vue 3 + Vite - 现代化开发体验
  • 📦 按需引入 - 支持全量和按需引入
  • 🎨 主题定制 - 基于 Element Plus 主题系统

📦 安装

# npm
npm install @xn-lib/component element-plus

# pnpm
pnpm add @xn-lib/component element-plus

# yarn
yarn add @xn-lib/component element-plus

🔨 使用

完整引入

import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import XnComponents from '@xn-lib/component'
import '@xn-lib/component/dist/index.css'

const app = createApp(App)
app.use(ElementPlus)
app.use(XnComponents)
app.mount('#app')

按需引入

<template>
  <xn-cascader
    v-model="value"
    :options="options"
    placeholder="请选择"
  />
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Cascader as XnCascader } from '@xn-lib/component'
import '@xn-lib/component/dist/index.css'
import type { CascaderOption } from '@xn-lib/component'

const value = ref(null)
const options = ref<CascaderOption[]>([
  {
    label: '选项1',
    value: '1',
    children: [
      { label: '子选项1-1', value: '1-1' }
    ]
  }
])
</script>

📝 TypeScript 支持

组件库使用 vue-tsc 自动生成类型声明,提供完整的类型支持:

  • ✅ 组件标签自动提示
  • ✅ Props 属性自动提示
  • ✅ Props 类型错误提示
  • ✅ 事件类型提示
  • ✅ 实例方法类型提示
import type {
  CascaderProps,
  CascaderOption,
  CascaderValue,
  CascaderInst
} from '@xn-lib/component'

// Props 类型
const props: CascaderProps = {
  modelValue: null,
  options: [],
  multiple: false
}

// Option 类型
const options: CascaderOption[] = [
  {
    label: '选项1',
    value: '1',
    children: []
  }
]

// 实例类型
import { ref } from 'vue'
const cascaderRef = ref<CascaderInst>()
cascaderRef.value?.focus()

📚 组件列表

Cascader 级联选择器

支持单选、多选、搜索、远程加载、虚拟滚动等功能。

查看文档

🔗 链接

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 License

MIT