liuguocan
2023-03-14 ef61883a5437d03c5e384ba0b35c3e0885a882ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<template>
  <drag-verify
    :width="width"
    :height="height"
    :text="text"
    :success-text="successText"
    :background="background"
    :progress-bar-bg="progressBarBg"
    :completed-bg="completedBg"
    :handler-bg="handlerBg"
    :handler-icon="handlerIcon"
    :text-size="textSize"
    :success-icon="successIcon"
    @passcallback="passcallback2"
    ref="Verify"
  >
  </drag-verify>
</template>
<script>
 
import dragVerify from 'vue-drag-verify'
import 'font-awesome/css/font-awesome.min.css'
export default {
  name: 'DragVerify',
  components: {
    dragVerify
  },
  data () {
    return {
      handlerIcon: 'fa fa-angle-double-right',
      successIcon: 'fa fa-check',
      background: '#f5f5f5',
      progressBarBg: 'rgba(71,141,251,0.5)',
      completedBg: '#1890ff',
      handlerBg: '#fff',
      text: '请将滑块拖动到右侧',
      successText: '验证成功',
      width: 350,
      height: 45,
      textSize: '14px',
      isCircle: 'true'
    }
  },
  methods: {
    passcallback2 () {
      if (this.$refs.Verify.isPassing) {
        this.$emit('success')
      }
    }
  }
}
</script>
<style>
.drag_verify .dv_handler_bg{
  width: 45px!important;
  height: 45px!important;
}
</style>