mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 12:28:33 +08:00
27 lines
665 B
TypeScript
27 lines
665 B
TypeScript
|
import React from 'react';
|
||
|
import { Button, Popover } from 'antd';
|
||
|
|
||
|
const style: React.CSSProperties = {
|
||
|
width: '300vw',
|
||
|
height: '300vh',
|
||
|
display: 'flex',
|
||
|
alignItems: 'center',
|
||
|
justifyContent: 'center',
|
||
|
};
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
React.useEffect(() => {
|
||
|
document.documentElement.scrollTop = document.documentElement.clientHeight;
|
||
|
document.documentElement.scrollLeft = document.documentElement.clientWidth;
|
||
|
}, []);
|
||
|
return (
|
||
|
<div style={style}>
|
||
|
<Popover content="Thanks for using antd. Have a nice day !" open>
|
||
|
<Button type="primary">Scroll The Window</Button>
|
||
|
</Popover>
|
||
|
</div>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|