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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@huteming/ui-button

v1.1.0

Published

> 按钮

Downloads

2

Readme

引入

import { Button } from '@huteming/ui'
Vue.use(Button)

代码演示

按钮类型

支持defaultprimaryinfowarningdanger五种类型,默认为default

<tm-button type="default">默认按钮</tm-button>
<tm-button type="primary">主要按钮</tm-button>
<tm-button type="info">信息按钮</tm-button>
<tm-button type="warning">警告按钮</tm-button>
<tm-button type="danger">危险按钮</tm-button>

朴素按钮

通过plain属性将按钮设置为朴素按钮,朴素按钮的文字为按钮颜色,背景为白色。

<tm-button plain type="primary">朴素按钮</tm-button>
<tm-button plain type="info">朴素按钮</tm-button>

禁用状态

通过disabled属性来禁用按钮,禁用状态下按钮不可点击

<tm-button disabled type="primary">禁用状态</tm-button>
<tm-button disabled type="info">禁用状态</tm-button>

加载状态

通过loading属性设置按钮为加载状态,加载状态下默认会隐藏按钮文字,可以通过loading-text设置加载状态下的文字

<tm-button loading type="primary" />
<tm-button loading type="info" loading-text="加载中..." />

按钮形状

通过shape设置按钮形状

<tm-button shape="square" type="primary">方形按钮</tm-button>
<tm-button shape="round" type="info">圆形按钮</tm-button>

图标按钮

通过icon属性设置按钮图标,支持 Icon 组件里的所有图标

<tm-button icon="help" type="primary" />

按钮尺寸

支持largenormalsmallmini四种尺寸,默认为normal

<tm-button type="primary" size="large">大号按钮</tm-button>
<tm-button type="primary" size="normal">普通按钮</tm-button>
<tm-button type="primary" size="small">小型按钮</tm-button>
<tm-button type="primary" size="mini">迷你按钮</tm-button>

API

Props

参数 | 说明 | 类型 | 可选值 | 默认值 | ----|--------|---------|---------|-----------| type | 类型 | string | primary info warning danger | default | size | 尺寸 | string | large small mini | normal | text | 按钮文字 | string | - | - | icon | 左侧图标名称,可选值见 Icon 组件 | string | - | - | block | 是否为块级元素 | boolean | - | false | plain | 是否为朴素按钮 | boolean | - | false | shape | 按钮形状 | string | square round | - | disabled | 是否禁用按钮 | boolean | - | false loading | 是否显示为加载状态 | boolean | - | false | loading-text | 加载状态提示文字 | string | - | - |

Events

事件名 | 说明 | 回调参数 | -------|-------|--------| click | 点击按钮 (注: loading 和 disabled 状态同样会触发) | event: Event |