添加 iconfont

608 阅读1分钟

添加 iconfont,需要添加到两个地方

  • 菜单栏 icon,需要在配置中 layout 属性中配置。
  • 项目页面中使用,需要在 <script> 中添加。

因为这两个都是公共的配置,所以在 config/config.ts 配置文件中进行统一配置即可。

// ? config/config.ts

const ICONFONT_URL = '//at.alicdn.com/t/font_3173501_te8zz1x69be.js';

export default defineConfig({
  headScripts: [ICONFONT_URL],
  layout: {
    iconfontUrl: ICONFONT_URL,
    // other config...
  },
  // other config...
});

[0] layout.iconfontUrl 配置

[1] headscripts 配置


返回目录文档