mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 09:49:57 +08:00
22c10212b6
* docs: add debug demo for segmented * chore: update * chore: update
715 B
715 B
order | title | debug | ||||
---|---|---|---|---|---|---|
99 |
|
true |
zh-CN
测试受控模式下两个 Segmented 同步 state。
en-US
Tests two Segmented synchronized states in controlled mode.
import { useState } from 'react';
import { Segmented } from 'antd';
const Demo = () => {
const [foo, setFoo] = useState('AND');
return (
<>
<Segmented
value={foo}
options={['AND', 'OR', 'NOT']}
onChange={e => setFoo(e.target.value)}
/>
<Segmented
value={foo}
options={['AND', 'OR', 'NOT']}
onChange={e => setFoo(e.target.value)}
/>
</>
);
};
export default Demo;