diff --git a/components/icon/demo/svg-sprite.md b/components/icon/demo/svg-sprite.md index cc81fb93c9..d5c7bc2b4f 100644 --- a/components/icon/demo/svg-sprite.md +++ b/components/icon/demo/svg-sprite.md @@ -37,7 +37,7 @@ const messageSymbol = ` `; // insert SVG symbols into document.body -if (document) { +if (typeof document === 'object') { const nodeId = '__SVG_SPRITE_NODE__'; const spriteContent = svgSpriteRenderer(nodeId, messageSymbol); const existing = document.getElementById(nodeId);