jiangchengfeiyi-xiaochengxu/common/globalFont.js

24 lines
558 B
JavaScript

export const getFonts =()=>{
//首页
uni.loadFontFace({
family: 'ZhongShanFonts',
source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/ZhongShanFonts.ttf")`,
success:(res) =>{
console.log('success',res);
},
fail:(err) => {
console.log('err',err);
}
})
//其他页面
uni.loadFontFace({
family: 'FangZhengFonts',
source: `url("https://carbon2.obs.cn-north-4.myhuaweicloud.com/fonts/FangZhengFonts.TTF")`,
success:(res) =>{
console.log('success',res);
},
fail:(err) => {
console.log('err',err);
}
})
}