|
@@ -5,7 +5,9 @@ import QRCode from '@/components/QRCode'
|
5
|
5
|
|
6
|
6
|
const style = {
|
7
|
7
|
display: 'flex',
|
8
|
|
- alignItem: 'center'
|
|
8
|
+ alignItem: 'center',
|
|
9
|
+ justifyContent: 'center',
|
|
10
|
+ flexDirection: 'column',
|
9
|
11
|
}
|
10
|
12
|
|
11
|
13
|
export default (props) => {
|
|
@@ -25,17 +27,17 @@ export default (props) => {
|
25
|
27
|
}
|
26
|
28
|
|
27
|
29
|
const content = (
|
28
|
|
- <QRCode ref={qrcodeRef} border content={text} title={title} />
|
|
30
|
+ <div style={style}>
|
|
31
|
+ <QRCode ref={qrcodeRef} border content={text} title={title} />
|
|
32
|
+ <div style={{ textAlign: 'center' }}>
|
|
33
|
+ <Button onClick={download} type='primary'>下载</Button>
|
|
34
|
+ </div>
|
|
35
|
+ </div>
|
29
|
36
|
)
|
30
|
37
|
|
31
|
38
|
return (
|
32
|
|
- <div style={style}>
|
33
|
|
- {/* 这个 div 主要用于下载 */}
|
34
|
|
- <div style={{ zIndex: -1, position: 'fixed', top: '-500vh' }}>{content}</div>
|
35
|
|
- <Popover content={content} placement="right">
|
36
|
|
- <QrcodeOutlined style={{ fontSize: '32px' }} />
|
37
|
|
- </Popover>
|
38
|
|
- <Button style={{ marginLeft: '16px' }} onClick={download} type='link'>下载</Button>
|
39
|
|
- </div>
|
|
39
|
+ <Popover content={content} placement="right">
|
|
40
|
+ <QrcodeOutlined style={{ fontSize: '32px' }} />
|
|
41
|
+ </Popover>
|
40
|
42
|
)
|
41
|
43
|
}
|