Skip to content

Commit 9aabd10

Browse files
authored
Update README.md
1 parent 62ff5be commit 9aabd10

File tree

1 file changed

+17
-9
lines changed

1 file changed

+17
-9
lines changed

README.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ Vue 纯前端的拼图人机验证、右滑拼图验证<br/>
66
![img](public/demo.gif)
77

88

9+
## 重要更新
10+
11+
2020/03/16 v1.1.0 **事件名改变** <br/>
12+
```
13+
@onSuccess -> @success
14+
@onClose -> @close
15+
@onFail -> @fail
16+
```
917
### 安装
1018

1119
```node
@@ -34,10 +42,10 @@ import Vcode from "vue-puzzle-vcode";
3442
<div>
3543
<Vcode
3644
:show="isShow"
37-
@onSuccess="onSuccess"
38-
@onClose="onClose"
45+
@success="success"
46+
@close="close"
3947
/>
40-
<button @click="onSubmit">登录</button>
48+
<button @click="submit">登录</button>
4149
</div>
4250
</template>
4351
@@ -53,15 +61,15 @@ import Vcode from "vue-puzzle-vcode";
5361
Vcode
5462
},
5563
methods:{
56-
onSubmit(){
64+
submit(){
5765
this.isShow = true;
5866
},
5967
// 用户通过了验证
60-
onSuccess(msg){
68+
success(msg){
6169
this.isShow = false; // 通过验证后,需要手动隐藏模态框
6270
},
6371
// 用户点击遮罩层,应该关闭模态框
64-
onClose(){
72+
close(){
6573
this.isShow = false;
6674
}
6775
}
@@ -84,9 +92,9 @@ import Vcode from "vue-puzzle-vcode";
8492
### 事件
8593
| 事件名 | 返回值 | 说明 |
8694
| --------- | ------ | ------------------------------------------------------------ |
87-
| onSuccess | 偏差值 | 验证通过时会触发,返回值是用户移动的距离跟目标距离的偏差值px |
88-
| onFail | 偏差值 | 验证失败时会触发,返回值同上 |
89-
| onClose | null | 用户点击遮罩层的回调 |
95+
| success | 偏差值 | 验证通过时会触发,返回值是用户移动的距离跟目标距离的偏差值px |
96+
| fail | 偏差值 | 验证失败时会触发,返回值同上 |
97+
| close | null | 用户点击遮罩层的回调 |
9098

9199
### 自定义图片
92100

0 commit comments

Comments
 (0)