其他分享
首页 > 其他分享> > 获取项目中的全部icon

获取项目中的全部icon

作者:互联网

第一步是本身icon是iconfont.json
格式是

{
  "id": "2989802",
  "name": "低代码平台",
  "font_family": "iconfont",
  "css_prefix_text": "icon-",
  "description": "FontClass/Symbol 前缀是icon-;Font Family 是iconfont;",
  "glyphs": [
    {
      "icon_id": "21823886",
      "name": "s-operation",
      "font_class": "s-operation",
      "unicode": "e678",
      "unicode_decimal": 59000
    },

  ]
}

第二步是vue项目是获取icon

  import iconList from '/@/../public/aliFont/iconfont.json';
  const originList = iconList.glyphs.map((item) => `icon-${item.font_class}`);

然后对数据进行处理

标签:iconfont,获取,全部,unicode,operation,font,id,icon
来源: https://blog.csdn.net/weixin_44242623/article/details/121990774