{"id":13563871,"url":"https://github.com/ganl/vue-icon-font","last_synced_at":"2025-08-16T13:30:42.744Z","repository":{"id":57396234,"uuid":"103359654","full_name":"ganl/vue-icon-font","owner":"ganl","description":"IconFont plugin for Vuejs","archived":false,"fork":false,"pushed_at":"2020-01-26T09:08:58.000Z","size":41,"stargazers_count":25,"open_issues_count":3,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-24T18:09:47.551Z","etag":null,"topics":["ico","icon","icon-font","vue","vue-components","vue2","vuejs"],"latest_commit_sha":null,"homepage":"https://ganl.github.io/vue-icon-font/demo/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ganl.png","metadata":{"files":{"readme":"README-cn.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-13T06:00:52.000Z","updated_at":"2023-02-17T00:41:56.000Z","dependencies_parsed_at":"2022-09-18T12:11:11.215Z","dependency_job_id":null,"html_url":"https://github.com/ganl/vue-icon-font","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganl%2Fvue-icon-font","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganl%2Fvue-icon-font/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganl%2Fvue-icon-font/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ganl%2Fvue-icon-font/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ganl","download_url":"https://codeload.github.com/ganl/vue-icon-font/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229810353,"owners_count":18127613,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ico","icon","icon-font","vue","vue-components","vue2","vuejs"],"created_at":"2024-08-01T13:01:24.159Z","updated_at":"2024-12-16T23:16:22.848Z","avatar_url":"https://github.com/ganl.png","language":"JavaScript","funding_links":[],"categories":["JavaScript","UI组件","Components \u0026 Libraries","UI Components","UI Components [🔝](#readme)"],"sub_categories":["图标","UI Components","Icons"],"readme":"\n比较流行的字体图标库有Font Awesome：The iconic font and CSS toolkit，还有Bootstrap默认带的Glyphicons字体图标（不过数量有限）；Iconfont，阿里推出的矢量图标管理平台，可以自己上传图标到Iconfont平台，用户可以自定义下载多种格式的icon，平台也可将图标转换为字体，便于调整与调用。\n\n产品的管理控制台上很多图标Font Awesome中都没有，多为UI设计的图标，选择了iconfont, 使用图标的地方较多，封装了一个简单的icon组件：\n**[vue-icon-font](https://github.com/ganl/vue-icon-font)**: \ta [iconfont](http://iconfont.cn/) plugin for Vuejs \n\n[![Build Status](https://travis-ci.org/ganl/vue-icon-font.svg?branch=master)](https://travis-ci.org/ganl/vue-icon-font)\n![Vue 2.x](https://img.shields.io/badge/vue-2.x-green.svg \"Vue 2 Compatible\")\n\n## Screenshots\n\n![screenshot](https://github.com/ganl/mdAssets/raw/master/img/vue-icon-font/WX20171013-003608@2x.png)\n![screenshot](https://github.com/ganl/mdAssets/raw/master/img/vue-icon-font/WX20171013-003725@2x.png)\n\n![screenshot](https://github.com/ganl/mdAssets/raw/master/img/vue-icon-font_20170913-223111%402x.png)\n\n\n## 阿里iconfont.cn\n\n注册后，创建项目，上传图标：[](http://iconfont.cn/manage/index)；或者在图标库中找到自己需要的图标添加到项目中来：[](http://iconfont.cn/collections/index)\n饿了么element官方给的引入第三方图标库指导步骤需要：\n\n1. 修改第三方图标库的前缀（见下方说明）\n2. 添加以下 CSS：\n\n```\n[class^=\"el-icon-my\"], [class*=\" el-icon-my\"] {\n  font-family:\"your-font-family\" !important;\n  \n  /* 以下内容参照第三方图标库本身的规则 */\n  font-size: inherit;\n  font-style:normal;\n  -webkit-font-smoothing: antialiased;\n  -moz-osx-font-smoothing: grayscale;\n}\n```\n之后就可以像使用 Element 内置图标一样使用第三方图标。比如在 el-input 中：\n\n`\u003cel-input icon=\"my-xxx\" /\u003e`\n\n[](http://element.eleme.io/#/zh-CN/component/icon#di-san-fang-tu-biao-ku)\n\n**使用vue-icon-font组件，不需要修改图标库的前缀，直接引入css和js相关资源文件即可**\n\n**使用方式：**`\u003cicon name=\"account\" type=\"class\"\u003e\u003c/icon\u003e`, name为平台上对应icon的Font Class / Symbol，type指定使用的font-class还是Symbol。\n\n## 安装vue-icon-font\n\n### NPM (推荐方式)\n\n``` bash\nnpm install vue-icon-font\n```\n\n### 手动引入\n\n``` html\n# Download `dist/vue-iconfont.js` from github and include it in your HTML file\n\u003cscript src=\"../dist/vue-iconfont.js\"\u003e\u003c/script\u003e\n```\n\n## Iconfont资源文件\n\n登录到iconfont.cn, 下载字体图标，并解压 `upzip download.zip`. \n![screenshot](https://github.com/ganl/mdAssets/raw/master/img/vue-icon-font/WX20171012-235647.png)\n组件支持font-class和symbol两种引用方式，推荐使用symbol，只需要引入iconfont.js即可。\n\n### font-class 引用\n\u003e 复制 `iconfont.css` 和 字体文件 (*.ttf,*.eot,*.svg,*.woff) 到工程中, 需要显式指定`type=class`\n\n``` html\n# Include the iconfont.css stylsheet into your \u003chead\u003e\n\u003clink rel=\"stylesheet\" href=\"./iconfont.css\"\u003e\n```\n\nor\n\n``` js\n# Import css\nimport './iconfont.css';\n```\n\n使用图标：`\u003cicon name=\"account\" type=\"class\"\u003e\u003c/icon\u003e`\n\n### symbol引用,svg (默认的,推荐的)\n\u003e 复制 `iconfont.js` 到工程中\n\n``` html\n# Include the iconfont.css stylsheet into your \u003chead\u003e\n\u003clink rel=\"stylesheet\" href=\"./iconfont.css\"\u003e\n```\n\nor\n\n``` js\nimport './iconfont.js';\n```\n\n使用图标：`\u003cicon name=\"password\"\u003e\u003c/icon\u003e`\n\n\n## Usage via import (vue-cli)\n``` js\nimport Vue from 'vue'\nimport VueIconFont from 'vue-icon-font'\nVue.use(VueIconFont)\n\n/* font-class */\nimport '@/assets/iconfont/iconfont.css'\n\n/* symbol,svg */\nimport '@/assets/iconfont/iconfont.js'\n\n```\n\n``` html\n\u003c!-- font-class --\u003e\n\u003cicon name=\"account\" type=\"class\"\u003e\u003c/icon\u003e\n\n\u003c!-- symbol,svg --\u003e\n\u003cicon name=\"password\"\u003e\u003c/icon\u003e\n```\n\n简单demo：[here](https://ganl.github.io/vue-icon-font/demo/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganl%2Fvue-icon-font","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fganl%2Fvue-icon-font","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fganl%2Fvue-icon-font/lists"}