Skip to content

Commit

Permalink
feat: improve demo
Browse files Browse the repository at this point in the history
  • Loading branch information
小豪 committed Oct 17, 2024
1 parent cb771fe commit 243125a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions examples/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ export default () => {

const [value2, setValue2] = React.useState<string[][]>([]);

const [disabled, setDisabled] = React.useState(false);

return (
<>
<h1>Panel</h1>
Expand All @@ -71,13 +73,21 @@ export default () => {
>
Set Value
</button>
<button
onClick={() => {
setDisabled(prev => !prev);
}}
>
{disabled ? 'enable panel' : 'disable panel'}
</button>
<Cascader.Panel
value={value}
options={addressOptions}
onChange={nextValue => {
console.log('Change:', nextValue);
setValue(nextValue);
}}
disabled={disabled}
/>

<Cascader.Panel
Expand All @@ -88,10 +98,9 @@ export default () => {
console.log('Change:', nextValue);
setValue2(nextValue);
}}
disabled={disabled}
/>

<Cascader.Panel disabled options={addressOptions} />

<Cascader.Panel options={addressOptions} direction="rtl" />

<Cascader.Panel notFoundContent="Empty!!!" />
Expand Down

0 comments on commit 243125a

Please sign in to comment.