字体相关调整

This commit is contained in:
tangly1024.com
2023-02-09 14:46:32 +08:00
parent f9d4472245
commit 6f13f0a57b
17 changed files with 42 additions and 43 deletions

View File

@@ -7,6 +7,7 @@
* @returns {Promise<unknown>}
*/
export function loadExternalResource(url, type) {
console.log('加载', url, type)
return new Promise((resolve, reject) => {
let tag
@@ -14,6 +15,11 @@ export function loadExternalResource(url, type) {
tag = document.createElement('link')
tag.rel = 'stylesheet'
tag.href = url
} else if (type === 'font') {
tag = document.createElement('link')
tag.rel = 'preload'
tag.as = 'font'
tag.href = url
} else if (type === 'js') {
tag = document.createElement('script')
tag.src = url