1.0.0 • Published 2 years ago

vue-prevention-robot v1.0.0

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

vue-prevention-robot

安装

npm install -S vue-prevention-robot

引入

const vuePreventionRobot = require("vue-prevention-robot")
Vue.use(vuePreventionRobot)

使用

<prevention-robot v-model="isVerificationShow1"  :puzzleImgList="puzzleImgList" :onSuccess="handleSuccess" />


<script>
    export default {
        data(){
			return {
                puzzleImgList: [
                    require("@/assets/thumbnail-img01.jpg"),
                    require("@/assets/thumbnail-img02.jpg"),
                    require("@/assets/thumbnail-img03.jpg")
                ]
            }
        }
    }
</script>

参数配置

参数名说明类型可选值默认值
verificationShow展示Booleantrue, falsefalse
width图片宽度String,Number260
height图片高度String,Number120
puzzleImgList图片集合Array默认图片
blockSize滑块大小String,Number40
blockRadius滑块圆角大小,blockType为square时有效String,Number4
deviation滑块误差判断String,Number4
wraperPadding滑块能出现的范围(距离右边的距离)String,Number20
blockType方块类型Stringsquare, puzzlesquare
onSuccess成功回调函数Function
onError失败回调函数Function

注意:puzzleImgList的图片列表 宽高最好统一,至少宽高比例一致,然后配置 width及 height。 防止图片变形。