您可以导入 SVG 和 HTML,然后在 Astro 组件中使用它们。HTML 支持作为组件导入和使用。SVG 可以使用后缀导入?raw,并且需要与set:html.
---
import HTMLSnippet from '../snippet.html';
import Icon from '../icon.svg?raw';
---
<HTMLSnippet />
<Fragment set:html={Icon} />
Run Code Online (Sandbox Code Playgroud)