ant-design/components/qr-code/demo/errorlevel.tsx
二货爱吃白萝卜 5bf08faeea
refactor: rename qrcode to qr-code (#43607)
* refactor: rename qrcode to qr-code

* test: patch test case

* chore: fix Form missing displayName

* chore: patch displayName

* chore: style path

* chore: fix compile
2023-07-17 23:43:32 +08:00

20 lines
555 B
TypeScript

import React, { useState } from 'react';
import type { QRCodeProps } from 'antd';
import { Segmented, QRCode } 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;