mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +08:00
Fix ssr
This commit is contained in:
parent
0125ae075f
commit
aadff2d569
@ -22,6 +22,7 @@ export default function svgBgToParallax(children, i = 0) {
|
||||
return svgChildren;
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
// 图处预加载;
|
||||
const div = document.createElement('div');
|
||||
div.style.display = 'none';
|
||||
@ -54,3 +55,4 @@ document.body.appendChild(div);
|
||||
img.src = src;
|
||||
div.appendChild(img);
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user