浏览器控制台报错如下:

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

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

相关文章:

  • 2022-01-10
  • 2022-12-23
  • 2021-05-05
  • 2021-12-10
  • 2021-10-27
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
猜你喜欢
  • 2021-10-17
  • 2021-12-02
  • 2021-06-24
  • 2022-12-23
  • 2021-06-26
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案