vue-captcha-code

1.0.2 • Public • Published

vue-captcha-code

基于 vuecanvas 的一个验证码组件

安装

npm install vue-captcha-code --save

APIS

点这里

基本用法

import VueCaptcha from 'vue-captcha-code';

const Template = (args, { argTypes }) => ({
  props: Object.keys(argTypes),
  data: function() {
    return {
      code: '',
    };
  },
  components: { VueCaptcha },
  methods: {
    handleChange(code) {
      console.log('code: ', code);
    },
    refresh() {
      this.$refs.captcha.refreshCaptcha();
    },
  },
  template: `
    <div>
      <vue-captcha 
        ref="captcha" 
        :captcha.sync="code"
        @on-change="handleChange">
      </vue-captcha>
      <div>
        <button @click="refresh">刷新</button>
      </div>
    </div>
  `,
});

在线示例

Edit vue-captcha s

Package Sidebar

Install

npm i vue-captcha-code

Weekly Downloads

38

Version

1.0.2

License

ISC

Unpacked Size

5.85 MB

Total Files

24

Last publish

Collaborators

  • motoka