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

@forzoom/mobile-button

v0.2.1

Published

规范网页中使用按钮的代码

Downloads

17

Readme

Target

规范网页中使用按钮的代码

Usage

Basic

import MobileButton from '@forzoom/mobile-button';
Vue.component('MobileButton', MobileButton);
<MobileButton tag="router-link"
	name="primary"
	to="/path/to/target"
	:is-block="true"
	:is-disabled="true">
	click me
</MobileButton>

生成的html

<router-link class="btn btn-mobile btn-primary btn-block disabled" to="/path/to/target">
	click me
</router-link>

使用类型为Object的to

<MobileButton tag="router-link"
	name="primary"
	tag="router-link"
	:to="{ name: 'path_to_target' }"
	:is-block="true"
	:is-disabled="true">
	click me
</MobileButton>

Props

|名称|类型|默认|描述| |---|---|---|---| |id|String|null|添加到外层元素的id| |class-list|Object/Array|null|添加到外层元素的class| |tag|String|a|生成的元素,例如可以是div/a/router-link等| |name|String|null|添加btn-${name}样式类,如果是空则不添加| |to|Object/String|null|点击导航地址,类似于router-link中的to。只有当tag的值为router-link时,to的类型允许是Object| |is-block|Boolean|false|是否添加btn-block样式类| |is-disabled|Boolean|false|是否添加disabled样式类| |is-selected|Boolean|false|是否添加selected样式类|

备注: 由于组件使用render函数渲染,暂时需要使用id和classList来传入id和class

Events

|名称|参数|描述| |---|---|---| |click|(event)|非disabled情况下点击将触发该事件| |click-when-disabled|(event)|disabled情况下点击将触发该事件|

Tip

  1. 为了iOS能够正常触发active效果,组件本身监听了touchstart事件
  2. 由于Vue的逻辑,实际上使用class就可以起到classList的效果