1 Star 2 Fork 0

snailboy/vue-sms-check-code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
3年前
3年前
Loading...
README
MIT

sms-check-code

license npm

演示

Install


1,npm install sms-check-code --save

2,import VueSmsCode from 'sms-check-code'

3,vue.use(VueSmsCode)


<sms-check-code
    title='请输入验证码' 
    :code-num='6'
    :is-error='isError'
    error-color='#D81A1A'
    @finish='getSmsCode'
/>
事件 说明 默认 类型
title 组件标题 请输入验证码 string
code-num 验证码个数 6 number
is-error 验证码是否错误 false boolean
error-color 验证码错误时显示的错误颜色 #D81A1A string
方法 说明 默认 类型
finish 验证码值 '' string

Usage

<template>
  <div id="app">
    <sms-check-code
        title='请输入验证码'
        :codeNum='6'
        :is-error='isError'
        error-color='#D81A1A'
        @finish='getSmsCode'
    />
    {{msg}}
  </div>
</template>

<script>
export default {
  name: 'App',
  data() {
    return {
      isError: false, // 验证码错误
      msg: ''
    }
  },
  methods: {
    getSmsCode(val) {
      this.isError = false
      this.msg = val
      setTimeout(() => {
        this.isError = val !== '888888';
        if(val === '888888') {
          this.msg = '验证码输入成功'
        }
      }, 1000)
    }
  }
}
</script>

<style>
html, body {
  padding: 0;
  margin: 0;
}
</style>

源码地址,欢迎star

github地址

gitee地址

1.0.3

解决 短信发送后 ios 软键盘不关闭的bug

MIT License Copyright (c) 2022-present, vueSmsCheckCode Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

一个仿原生效果的短信验证码组件,vue2.6插件,无依赖。验证失败时动画加标红颜色显示,点击手机验证码平铺填充等 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者 (1)

全部

近期动态

接近3年前推送了新的提交到 master 分支,0e87be8...f0d1852
接近3年前推送了新的提交到 master 分支,6d78542...0e87be8
接近3年前推送了新的提交到 master 分支,4a2a0d4...6d78542
3年前推送了新的提交到 master 分支,6c10637...4a2a0d4
3年前推送了新的提交到 master 分支,a5a41a9...6c10637
加载更多
不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/snailwebboy/sms-check-code.git
git@gitee.com:snailwebboy/sms-check-code.git
snailwebboy
sms-check-code
vue-sms-check-code
master

搜索帮助