功能变化: 将网络字体改为本地字体

This commit is contained in:
猿小天
2023-12-26 11:33:37 +08:00
parent 217f3c8e14
commit 86e33e44e1
10 changed files with 2688 additions and 1 deletions

View File

@@ -50,6 +50,17 @@ const getAwesomeIconfont = () => {
const styles: any = document.styleSheets;
let sheetsList = [];
let sheetsIconList = [];
// 判断fontFamily是否是本地加载
for (let i = 0; i < styles.length; i++) {
const rules = styles[i].cssRules || styles[i].rules;
if (rules) {
for (let j = 0; j < rules.length; j++) {
if (rules[j].style && rules[j].style.fontFamily === 'FontAwesome') {
sheetsList.push(styles[i])
}
}
}
}
for (let i = 0; i < styles.length; i++) {
if (styles[i].href && styles[i].href.indexOf('netdna.bootstrapcdn.com') > -1) {
sheetsList.push(styles[i]);

View File

@@ -2,7 +2,7 @@
const cssCdnUrlList: Array<string> = [
'//at.alicdn.com/t/font_2298093_y6u00apwst.css',
'//at.alicdn.com/t/c/font_3882322_9ah7y8m9175.css', //dvadmin3项目用icon
'//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'
//'//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css'
];
// 第三方 js url
const jsCdnUrlList: Array<string> = [];