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

youyu-button

v0.0.2

Published

A custom button component for Vue 3

Readme

youyu-button

一个基于 Vue 3 的自定义按钮组件插件,提供丰富的样式和配置选项。

功能特性

  • 支持多种按钮类型:默认、主要、次要、成功、警告、危险、信息
  • 支持多种按钮尺寸:迷你(MINI)、小(S)、中(M)、大(L)、特大(XL)
  • 支持圆角样式
  • 支持激活和禁用状态
  • 支持自定义类名
  • 响应式设计

安装

# 使用 npm
npm install youyu-button

# 使用 yarn
yarn add youyu-button

# 使用 pnpm
pnpm add youyu-button

使用

全局安装

// main.ts
import { createApp } from "vue";
import YouyuButtonPlugin from "youyu-button";
import "youyu-button/dist/main.css";

const app = createApp(App);
app.use(YouyuButtonPlugin);
app.mount("#app");

局部使用

<script setup lang="ts">
import { YouyuButton } from "youyu-button";
import "youyu-button/dist/main.css";
</script>

<template>
  <YouyuButton type="primary">主要按钮</YouyuButton>
</template>

组件属性

| 属性名 | 类型 | 默认值 | 说明 | | --------- | ------- | ------- | --------------------------------------------------------------------- | | type | string | default | 按钮类型:default, primary, secondary, success, warning, danger, info | | size | string | M | 按钮尺寸:MINI, S, M, L, XL | | rounded | boolean | false | 是否显示圆角 | | active | boolean | false | 是否激活状态 | | disabled | boolean | false | 是否禁用状态 | | className | string | | 自定义类名 |

事件

| 事件名 | 说明 | 参数 | | ------ | -------- | ---------- | | click | 点击事件 | MouseEvent |

示例

基础按钮

<YouyuButton type="default">默认按钮</YouyuButton>
<YouyuButton type="primary">主要按钮</YouyuButton>
<YouyuButton type="success">成功按钮</YouyuButton>
<YouyuButton type="warning">警告按钮</YouyuButton>
<YouyuButton type="danger">危险按钮</YouyuButton>

不同尺寸

<YouyuButton type="primary" size="MINI">迷你按钮</YouyuButton>
<YouyuButton type="primary" size="S">小按钮</YouyuButton>
<YouyuButton type="primary" size="M">中按钮</YouyuButton>
<YouyuButton type="primary" size="L">大按钮</YouyuButton>
<YouyuButton type="primary" size="XL">特大按钮</YouyuButton>

圆角按钮

<YouyuButton type="primary" rounded>圆角按钮</YouyuButton>

激活和禁用状态

<YouyuButton type="primary" active>激活按钮</YouyuButton>
<YouyuButton type="primary" disabled>禁用按钮</YouyuButton>

自定义类名

<YouyuButton type="primary" className="custom-button">自定义按钮</YouyuButton>

项目开发

安装依赖

pnpm install

开发模式

pnpm dev

构建生产版本

pnpm build

许可证

MIT