Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
timer-btn
Advanced tools
Readme
限制点击时间的按钮,可用于短信验证码等场景,相关样式持续更新中。
$ npm install --save timer-btn
注册组件
import Vue from 'vue'
import timerBtn from 'timer-btn'
Vue.component('timerBtn', timerBtn)
使用组件
<template>
//按钮的样式根据您所选用的ui框架选择class
<timer-btn class="ivu-btn ivu-btn-default" v-on:beforeStart="sendCode()"
v-on:end="endTime" :second="30" textBeforeClick="发送验证码" textAfterClick="秒后重新获取"></timer-btn>
</template>
<script>
export default {
//发送验证码
sendCode () {
//检查form
//确认执行发送逻辑
if (true) {
console.log('您点击了按钮,按钮将会在您指定的时间之内不可用,并显示倒计时');
timerBtn.start();
} else {
// your logic
}
},
//验证码按钮的等待时间结束
end () {
console.log('end');
}
}
</script>
类型: Number
必要性: false
默认值: 60
定义按钮点击后,所需要等待的时间,单位秒
类型: Boolean
必要性: false
默认值: false
按钮点击后,处于disabled状态,此时按钮不可点击
类型: String
必要性: false
默认值: 获取验证码
按钮点击之前显示的文本
类型: String
必要性: false
默认值: s 后重新获取
按钮点击之后显示的文本,second的倒计时会在文本最前面显示,所以一般会加一个"秒"或者"s"
添加更cool的倒计时样式
添加更完善的响应事件
FAQs
The npm package timer-btn receives a total of 0 weekly downloads. As such, timer-btn popularity was classified as not popular.
We found that timer-btn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.