添加 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...
});
[1] headscripts 配置