1. 演示
成功:
失败:
失败过多:
初始化:
2.安装及使用:
安装:
npm install huakuai-vue --save
main.js使用:
import huakuai from 'huakuai-vue'
Vue.use(huakuai)
全局就可以使用了,不需要在注册
<hua-kuai></hua-kuai>
事件参数:
事件名 | 类型 | 描述 |
---|---|---|
verify | 事件 | 判断用户滑动验证是否通过,成功为true,失败三次为false |
refresh | 事件 | 用户失败三次点击了初始化按钮 |
示例:
<template>
<div class=''>
<hua-kuai @verify='verify' @refresh='refresh'></hua-kuai>
</div>
</template>
<script>
// import huakuai from './components/huakuai'
export default {
// components:{
// huakuai
// }
methods:{
verify(result){
console.log(result) // result为true表示验证通过,false表示验证三次都失败了哦
},
refresh(){
console.log('用户点击了初始化')
}
}
}
</script>
<style scoped>
</style>
标签:初始化,插件,Vue,滑块,验证,失败,result,huakuai
From: https://www.cnblogs.com/yangyezhuang/p/17185218.html