Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何通过cdn引入@ant-design/icons-vue图标? #680

Open
huangmingfu opened this issue Jan 20, 2025 · 1 comment
Open

如何通过cdn引入@ant-design/icons-vue图标? #680

huangmingfu opened this issue Jan 20, 2025 · 1 comment

Comments

@huangmingfu
Copy link

我尝试使用以下方式导入:

<script type="importmap">
  {
    "imports": {
      "@ant-design/icons-vue": "https://cdn.jsdelivr.net/npm/@ant-design/icons-vue@7.0.1/es/index.js"
    }
  }
</script>
<script type="module">
  import { HomeOutlined } from "@ant-design/icons-vue";
  console.log(`HomeOutlined -->`, HomeOutlined);
</script>

但是有些文件加载不了:

Image

Image

然后我查了一下,使用这种:

<script type="importmap">
  {
    "imports": {
      "@ant-design/icons-vue": "https://cdn.jsdelivr.net/npm/@ant-design/icons-vue@latest/+esm"
    }
  }
</script>

报另一个错误(相关链接):

Image

@huangmingfu
Copy link
Author

相关issue #668

@element-plus/icons-vue 图标参考

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant