Skip to content

Commit b5a30c6

Browse files
committed
chore(ui): adjust radio demo
1 parent 723aa86 commit b5a30c6

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

packages/ui/src/components/radio/demos/1.Basic.md

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,26 @@ The simplest usage.
1313
最简单的用法。
1414

1515
```tsx
16-
import { DRadio } from '@react-devui/ui';
16+
import { useState } from 'react';
17+
18+
import { DButton, DRadio } from '@react-devui/ui';
1719

1820
export default function Demo() {
21+
const [disabled, setDisabled] = useState(false);
22+
1923
return (
2024
<>
21-
<DRadio>Radio</DRadio>
22-
<DRadio dDisabled>Radio</DRadio>
23-
<DRadio dDisabled dModel={true}>
25+
<DButton
26+
onClick={() => {
27+
setDisabled((prev) => !prev);
28+
}}
29+
>
30+
Toggle disabled
31+
</DButton>
32+
<br />
33+
<br />
34+
<DRadio dDisabled={disabled}>Radio</DRadio>
35+
<DRadio dDisabled={disabled} dModel>
2436
Radio
2537
</DRadio>
2638
</>

0 commit comments

Comments
 (0)