vue3-swipe-verify
v1.0.7-rc.9
Published
```sh npm install --save-dev vue3-swipe-verify ```
Downloads
9
Readme
Quick Start
1. Import vue3-swipe-verify into your vue3 project.
npm install --save-dev vue3-swipe-verify
全局注册
import sv from "vue3-swipe-verify";
import "vue3-swipe-verify/dist/style.css";
const app = createApp(App);
app.use(sv);
按需引入
import { SwipeVerify } from "vue3-swipe-verify";
import "vue3-swipe-verify/dist/style.css";
argument
| Param | Type | Describe | Version | | :--------: | :-----: | :---------------------------------: | :-----: | | l | Number | 滑块长度 | | | r | Number | 滑块圆角 | | | w | Number | canvas width | | | h | Number | canvas height | | | swiperText | String | Swipe filled right | | | imgs | Array | picture array 背景图数组,默认值 [] | | | accuracy | Number | 滑动验证的误差范围,默认值 5 | | | show | Boolean | 是否显示刷新按钮,默认值 true | | | interval | Number | 节流函数的时间间隔,默认值 50 | 1.1.2 |
callBack
| Event | Type | Describe | Version | | :-----: | :------: | :----------------------------------: | :----------------------: | | success | Function | success callback | 返回时间参数,单位为毫秒 | | fail | Function | fail callback | | | refresh | Function | 点击刷新按钮后的回调函数 | | | again | Function | 检测到非人为操作滑动时触发的回调函数 | |