1.0.3 • Published 2 years ago

vue-sms-check-code v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

vue-sms-check-code

license npm

演示

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

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

3,vue.use(VueSmsCode)
<vue-sms-check-code
    title='请输入验证码' 
    :code-num='6'
    :is-error='isError'
    error-color='#D81A1A'
    @finish='getSmsCode'
/>
事件说明默认类型
title组件标题请输入验证码string
code-num验证码个数6number
is-error验证码是否错误falseboolean
error-color验证码错误时显示的错误颜色#D81A1Astring
方法说明默认类型
finish验证码值''string
<template>
  <div id="app">
    <vue-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>

github地址

gitee地址

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago

1.0.0

2 years ago