import React from 'react'; import { Cascader } from 'antd'; import SemanticPreview from '../../../.dumi/components/SemanticPreview'; import useLocale from '../../../.dumi/hooks/useLocale'; const locales = { cn: { root: '根元素', 'popup.root': '弹出菜单元素', }, en: { root: 'Root element', 'popup.root': 'Popup element', }, }; const options = [ { value: 'contributors', label: 'contributors', children: [ { value: 'aojunhao123', label: 'aojunhao123', }, { value: 'thinkasany', label: 'thinkasany', }, ], }, ]; const Block = (props: any) => { const divRef = React.useRef(null); const [value, setValue] = React.useState(['contributors', 'aojunhao123']); const onChange = (newValue: string[]) => { setValue(newValue); }; return (
divRef.current} value={value} onChange={onChange} options={options} placement="bottomLeft" />
); }; const App: React.FC = () => { const [locale] = useLocale(locales); return ( ); }; export default App;