Skip to content

Commit 6c3accf

Browse files
authored
Update README.md
1 parent 974043c commit 6c3accf

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

README.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,15 @@ import Vcode from 'react-vcode';
2222
<Vcode />
2323
2424
````
25+
## 3. 服务端渲染
26+
```
27+
import Vcode from 'react-vcode';
2528
26-
## 3. 自定义参数
29+
<Vcode id="vcode" />
30+
```
31+
需要自己加个id, 不然服务端渲染和本地渲染,id变了会报错,因为Vcode内部使用了随机值
32+
33+
## 4. 自定义参数
2734

2835
可自行设置覆盖原有值
2936

@@ -89,14 +96,14 @@ options:{ // 验证码相关自定义参数
8996
/>
9097
````
9198

92-
## 4. 手动刷新验证码
99+
## 5. 手动刷新验证码
93100
```javascript
94101
<Vcode ref={(obj)=>this.vcode = obj} />
95102

96103
this.vcode.onClick(); // 调用内部的onClick方法可刷新验证码
97104
```
98105

99-
## 5. 额外说明
106+
## 6. 额外说明
100107

101108
- 之前用过一个验证码插件叫 vcode.js, 不知道作者。 本react-vcode是通过vcode.js的源码进行修改加工,转成了react组件。感谢原作者。
102109

0 commit comments

Comments
 (0)