Vue elementui字體圖標(biāo)顯示問題解決方案
問題如下
在build/utils.js下找到
if (options.extract) { return ExtractTextPlugin.extract({ use: loaders, fallback: ’vue-style-loader’, publicPath: ’../../’ }) } else { return [’vue-style-loader’].concat(loaders) }
加上
publicPath: ’../../’
運(yùn)行項目還是不行 ,F(xiàn)ailed to decode downloaded font: http://192.168.11.110:8081/dist/static/font 路徑也是對的
網(wǎng)上搜了很多,大部分說是后臺經(jīng)過maven的filter,會破壞font文件的二進(jìn)制文件格式,導(dǎo)致前臺解析出錯
但是我的是運(yùn)行在本地環(huán)境下,還沒有進(jìn)行打包部署
解決方式:
在maven文件的pom文件的build標(biāo)簽加入下面的
<plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-resources-plugin</artifactId> <configuration> <nonFilteredFileExtensions><nonFilteredFileExtension>ttf</nonFilteredFileExtension> <nonFilteredFileExtension>woff</nonFilteredFileExtension><nonFilteredFileExtension>woff2</nonFilteredFileExtension> </nonFilteredFileExtensions> </configuration> </plugin>
重啟項目,這樣應(yīng)該就可以了
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持好吧啦網(wǎng)。
相關(guān)文章:
1. PHP與已存在的Java應(yīng)用程序集成2. JS繪圖Flot如何實現(xiàn)動態(tài)可刷新曲線圖3. CSS自定義滾動條樣式案例詳解4. 使用ProcessBuilder調(diào)用外部命令,并返回大量結(jié)果5. 詳解CSS不定寬溢出文本適配滾動6. 使用css實現(xiàn)全兼容tooltip提示框7. python中if嵌套命令實例講解8. IDEA項目的依賴(pom.xml文件)導(dǎo)入問題及解決9. Java之JSP教程九大內(nèi)置對象詳解(中篇)10. Python實現(xiàn)查找數(shù)據(jù)庫最接近的數(shù)據(jù)
