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

lsy_ui_template

v0.1.3

Published

基于 Naive UI 二次封装的 Vue 3 UI 组件库模板,可以发布到 npm 使用。

Readme

lsy_ui_template

基于 Naive UI 二次封装的 Vue 3 UI 组件库模板,可以发布到 npm 使用。

特性

  • 📦 开箱即用的 Vue 3 组件
  • 🎨 基于 Naive UI 的样式系统
  • 🚀 完整的 TypeScript 类型支持
  • 🔧 简单易用的 API 设计
  • 📱 响应式设计

安装

npm install lsy_ui_template naive-ui @vicons/material
# 或
pnpm add lsy_ui_template naive-ui @vicons/material
# 或
yarn add lsy_ui_template naive-ui @vicons/material

使用

全局引入

// main.ts
import { createApp } from 'vue'
import App from './App.vue'
import LsyUI from 'lsy_ui_template'
import 'lsy_ui_template/style.css' // 这会自动映射到 dist/lsy_ui_template.css

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

按需引入

// 导入组件
import { Button, Input, Card } from 'lsy_ui_template'
// 导入样式
import 'lsy_ui_template/style.css' // 这会自动映射到 dist/lsy_ui_template.css

// 在组件中使用
components: {
  Button,
  Input,
  Card
}

组件列表

工具函数

组件库的工具函数已单独打包为 lsy_ui_utils,可以通过以下方式导入使用:

// 方式1:单独导入utils包
import * as utils from 'lsy_ui_utils'
// 或者
import utils from 'lsy_ui_utils'

// 格式化日期
handleDate() {
  const now = new Date()
  const formattedDate = utils.formatDate(now, {
    options: { year: 'numeric', month: 'long', day: 'numeric' }
  })
  console.log(formattedDate) // 输出类似:2024年7月25日
}

// 检查值是否为空
checkEmpty() {
  console.log(utils.isEmpty('')) // true
  console.log(utils.isEmpty({})) // true
  console.log(utils.isEmpty('hello')) // false
}```

### Button 按钮

```vue
<Button>默认按钮</Button>
<Button type="primary">主要按钮</Button>
<Button type="success">成功按钮</Button>
<Button type="warning">警告按钮</Button>
<Button type="error">错误按钮</Button>
<Button type="info">信息按钮</Button>
<Button size="small">小按钮</Button>
<Button size="large">大按钮</Button>
<Button disabled>禁用按钮</Button>
<Button :loading="true">加载按钮</Button>
<Button circle>O</Button>
<Button ghost>幽灵按钮</Button>
<Button dashed>虚线按钮</Button>

Input 输入框

<Input placeholder="请输入内容" />
<Input type="password" placeholder="请输入密码" />
<Input v-model="value" placeholder="双向绑定" />
<Input size="small" placeholder="小尺寸" />
<Input size="large" placeholder="大尺寸" />
<Input readonly placeholder="只读" />
<Input disabled placeholder="禁用" />
<Input maxlength="10" showWordLimit placeholder="带字数限制" />

Card 卡片

<Card title="卡片标题">
  卡片内容
</Card>
<Card title="可关闭卡片" closable @close="handleClose">
  点击右上角关闭按钮可以关闭卡片
</Card>
<Card title="无边框卡片" :bordered="false">
  无边框样式的卡片
</Card>
<Card title="带额外内容的卡片">
  <template #header-extra>
    <Button size="small">操作</Button>
  </template>
  带额外内容的卡片
</Card>

开发

# 安装依赖
npm install

# 启动开发服务器
npm run dev

# 构建组件库
npm run build:lib

# 预览构建结果
npm run preview

# 发布到 npm
npm run pub

开发说明

  • 组件源码位于 src/components/ 目录下
  • 组件类型定义位于 src/types/ 目录下
  • 组件样式位于 src/styles/ 目录下
  • 演示页面位于 src/App.vue

License

MIT