Last active
February 20, 2021 06:46
-
-
Save Jayin/98db4fc5fa1e5326870adf5805ef812a to your computer and use it in GitHub Desktop.
筛选出icon的名称
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 使用方法:在页面注入jquery 然后对应平台控制台中输入下面代码 | |
| // NO.1 Element icon 名字筛选 | |
| // 从页面 https://element.eleme.cn/2.13/#/zh-CN/component/icon 中注入执行 | |
| var iconNames = [] | |
| var iconElements = $('.icon-list li span.icon-name') | |
| iconElements.each(function(index){ | |
| iconNames.push(iconElements[index].innerText) | |
| }) | |
| console.log(iconNames); // ['el-icon-ice-cream-round',....] | |
| // NO.2 iconfont.cn 项目页获取icon名列表 ,如:https://www.iconfont.cn/manage/index?manage_type=myprojects&projectId=130644 | |
| var iconNames = [] | |
| var iconElements = $('.block-icon-list li span.icon-code-show') | |
| iconElements.each(function(index){ | |
| iconNames.push(iconElements[index].innerText) | |
| }) | |
| console.log(iconNames); | |
| // NO.3 iconfont.cn 项目下载包里面的demo_index.html 中提取iconfont | |
| var iconNames = [] | |
| var iconElements = $('.font-class .icon_lists li div.code-name') | |
| iconElements.each(function(index){ | |
| iconNames.push(iconElements[index].innerText.substr(1)) | |
| }) | |
| console.log(iconNames); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment