A Vue plugin to slide verify Demo
# install dependencies
npm install
# serve with hot reload at localhost:8080
npm run dev
# build for production with minification
npm run build
Using build tools:
npm install --save vue-monoplasty-slide-verify
import Vue from 'vue';
import SlideVerify from 'vue-monoplasty-slide-verify';
Vue.use(SlideVerify);
<slide-verify :l="42"
:r="10"
:w="310"
:h="155"
slider-text="向右滑动"
@success="onSuccess"
@fail="onFail"
@refresh="onRefresh"
></slide-verify>
<div>{{msg}}</div>
export default {
name: 'App',
data(){
return {
msg: '',
}
},
methods: {
onSuccess(){
this.msg = 'login success'
},
onFail(){
this.msg = ''
},
onRefresh(){
this.msg = ''
}
}
}
Param | Type | Describe |
---|---|---|
l | Number | block length |
r | Number | block circle radius |
w | Number | canvas width |
h | Number | canvas height |
sliderText | String | Slide filled right |
Event | Type | Describe |
---|---|---|
success | Function | success callback |
fail | Function | fail callback |
refresh | Function | refresh button callback |
- Mobile terminal touch event support
- add slider text