Skip to content

Commit d7f04f7

Browse files
committed
fix: value change rerender
1 parent 670c32d commit d7f04f7

File tree

3 files changed

+163
-144
lines changed

3 files changed

+163
-144
lines changed

docs/demo/demo-05.tsx

+8-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,18 @@ import React from 'react';
22
import GesturePassword, { GesturePasswordProps } from '@alitajs/gesture-password-react';
33

44
export default () => {
5+
const [value,setValue] = React.useState([1, 5, 9, 8, 6, 3, 2, 4, 7])
56
const config: GesturePasswordProps = {
67
width: 375,
78
height: 300,
89
hd: true,
9-
value: [1, 5, 9, 8, 6, 3, 2, 4, 7],
10-
disable: true,
11-
onChange: (data: any) => console.log(data) // get gesture password
10+
value,
11+
// 不可编辑
12+
// disable: false,
13+
onChange: (data: any) => {
14+
setValue(data);
15+
console.log(data) // get gesture password{
16+
}
1217
};
1318

1419
return <GesturePassword {...config} />;

docs/example.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<code src="./demo/demo-01.tsx" />
66

7-
## 回显且不可编辑示例
7+
## 回显示例
88

99
<code src="./demo/demo-05.tsx" />
1010

0 commit comments

Comments
 (0)