文章目录
- 代码实现:
js
import { Spin } from 'antd';
import { useState } from 'react';
export default function () {
const [loading, setLoading] = useState(true);
return (
<div style={{ position: 'relative', height: '100%' }}>
<Spin
style={{ position: 'absolute', marginLeft: '40vw', marginTop: '40vh' }}
spinning={loading}
tip="加载页面资源中..."
/>
<iframe
src={url}
allow="fullscreen"
onLoad={() => {
setLoading(false);
}}
style={{
height: '100%',
width: '100%',
border: 'none',
}}
/>
</div>
);
}