ant-design/components/qrcode/demo/base.tsx
二货爱吃白萝卜 1a1fdf0cee
docs: Update QR Code basic demo (#41614)
* docs: Update qr code demo

* docs: update demo
2023-04-03 22:34:05 +08:00

21 lines
447 B
TypeScript

import { Input, QRCode, Space } from 'antd';
import React from 'react';
const App: React.FC = () => {
const [text, setText] = React.useState('https://ant.design/');
return (
<Space direction="vertical" align="center">
<QRCode value={text || '-'} />
<Input
placeholder="-"
maxLength={60}
value={text}
onChange={(e) => setText(e.target.value)}
/>
</Space>
);
};
export default App;