zoukankan      html  css  js  c++  java
  • springboot项目中ttf和woff字体图标页面无法显示

    浏览器控制台报错如下:

    Failed to decode downloaded font: http://127.0.0.1:8081/fonts/element-icons.woff
    index:1 OTS parsing error: incorrect file size in WOFF header
    index:1 Failed to decode downloaded font: http://127.0.0.1:8081/fonts/element-icons.ttf
    index:1 OTS parsing error: incorrect entrySelector for table directory

    解决办法

    在网上找到了不下于4种解决方法,只有下面一种可行。 在pom.xml的build节点下添加

    <resources>
        <resource>
            <directory>${project.basedir}/src/main/resources</directory>
            <filtering>true</filtering>
            <excludes>
                <exclude>static/js/element-ui/fonts/**</exclude>
            </excludes>
        </resource>
        <resource>
            <directory>${project.basedir}/src/main/resources</directory>
            <filtering>false</filtering>
            <includes>
                <include>static/js/element-ui/fonts/**</include>
            </includes>
        </resource>
    </resources>

    注意:directory是 ${project.basedir}/src/main/resources

    百度其他的几种方式皆无效,给我干自闭了

  • 相关阅读:
    JSP一个简单的项目实现教程
    多个Excel文件快速导入到DB里面
    NotePad++左侧导航
    简单实用JSTL标签库
    Eclipse导入现有项目
    Java工具Eclipse
    winform窗体只能放大不能缩小
    ref out

    数组
  • 原文地址:https://www.cnblogs.com/yushuo/p/14334144.html
Copyright © 2011-2022 走看看