Skip to content

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

Open
@huangmingfu

Description

@huangmingfu

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

<script type="importmap">
  {
    "imports": {
      "@ant-design/icons-vue": "https://cdn.jsdelivr.net/npm/@ant-design/[email protected]/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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions