Skip to content

Commit

Permalink
feat(slider-vertify): 新增slider-vertify滑块验证组件
Browse files Browse the repository at this point in the history
  • Loading branch information
monsterxwx committed Jul 4, 2023
1 parent 4b2a2b1 commit 64cbab3
Show file tree
Hide file tree
Showing 6 changed files with 575 additions and 2 deletions.
44 changes: 44 additions & 0 deletions docs/component/sliderVertify.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<script setup>
import useCompStore from '../store/copname.js'
import { onMounted } from 'vue'
const compStore =useCompStore()

onMounted(()=>{
compStore.updateName('slider-vertify')
})

</script>

## 基本使用

```html
<uvSliderVertify />
```

#

## props

| 属性 | 含义 | 类型 | 默认值 |
| --------------- | :----------------------------------------: | :------: | ------------------------------------: |
| width | canvas宽度 | Number | 320 |
| height | canvas高度 | Number | 160 |
| visible | 是否可见 | Boolean | true |
| refreshIcon | 刷新icon地址 | String | 'http://cdn.dooring.cn/dr/icon12.png' |
| l | 滑块边长 | Number | 42 |
| r | 滑块半径 | Number | 9 |
| imgUrl | 图片地址 | String | '' |
| text | 文字 | String | '' |
| onDraw | 拖拽滑块时的回调, 参数为当前滑块拖拽的距离 | Function | (l) => {} |
| onCustomVertify | 用户的自定义验证逻辑 | Function | (VertifyType) => VertifyType |
| onBeforeRefresh | 重制刷新前的回调 | Function | () => {} |
| onSuccess | 验证成功回调 | Function | () => {} |
| onFail | 验证失败回调 | Function | () => {} |
| onRefresh | 刷新时回调 | Function | () => {} |


## css变量

```css

```
8 changes: 8 additions & 0 deletions examples/src/router/routerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,14 @@ export default [
},
component: () => import('../../../packages/components/floating-panel/demo/index.vue')
},
{
path: '/slider-vertify',
name: 'slider-vertify',
meta: {
name: 'SliderVertify 滑块验证'
},
component: () => import('../../../packages/components/slider-vertify/demo/index.vue')
},
{
path: '',
meta: {
Expand Down
7 changes: 5 additions & 2 deletions packages/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import uvCircleProgress from './circle-progress'
import uvUploader from './uploader'
import uvCascader from './cascader'
import uvFloatingPanel from './floating-panel'
import uvSliderVertify from './slider-vertify'

const components = [
uvButton,
Expand Down Expand Up @@ -131,7 +132,8 @@ const components = [
uvCircleProgress,
uvUploader,
uvCascader,
uvFloatingPanel
uvFloatingPanel,
uvSliderVertify
]

const install = (Vue) => {
Expand Down Expand Up @@ -205,7 +207,8 @@ export {
uvCircleProgress,
uvUploader,
uvCascader,
uvFloatingPanel
uvFloatingPanel,
uvSliderVertify
}

export default install
17 changes: 17 additions & 0 deletions packages/components/slider-vertify/demo/index.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<template>
<div>
<demoBlock title="基本使用">
<uvSliderVertify />
</demoBlock>
</div>
</template>

<script setup>
import demoBlock from '../../../demo/demo-block.vue'
import { uvSliderVertify } from 'uv-ui'
</script>

<style lang="scss" scoped>
</style>
6 changes: 6 additions & 0 deletions packages/components/slider-vertify/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import SliderVertify from './slider-vertify.vue'
import { withInstall } from '../../utils/index.js'

const uvSliderVertify = withInstall(SliderVertify)

export default uvSliderVertify
Loading

0 comments on commit 64cbab3

Please sign in to comment.