mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-02 12:09:14 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
20 lines
555 B
TypeScript
20 lines
555 B
TypeScript
import React, { useState } from 'react';
|
|
import type { QRCodeProps } from 'antd';
|
|
import { QRCode, Segmented } from 'antd';
|
|
|
|
const App: React.FC = () => {
|
|
const [level, setLevel] = useState<string | number>('L');
|
|
return (
|
|
<>
|
|
<QRCode
|
|
style={{ marginBottom: 16 }}
|
|
errorLevel={level as QRCodeProps['errorLevel']}
|
|
value="https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg"
|
|
/>
|
|
<Segmented options={['L', 'M', 'Q', 'H']} value={level} onChange={setLevel} />
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|