【发布时间】:2019-02-11 12:37:41
【问题描述】:
我正在尝试在我的 Vue 应用程序(使用 Vue cli webpack 模板创建)的某个组件中导入网络字体。在我的一个组件中,我尝试通过在具有以下内容的项目中引用 _fonts.scss 来导入字体:
@font-face {
font-family: 'SomeFont';
src: url('~/assets/fonts/SomeFont-Regular.woff2') format('woff2'),
url('~/assets/fonts/SomeFont-Regular.woff') format('woff');
font-weight: normal;
font-style: normal;
}
然后,当我打开应用程序时,我收到此错误:
Failed to decode downloaded font: http://localhost:8080/assets/fonts/SomeFont-Regular.woff2
Failed to decode downloaded font: http://localhost:8080/assets/fonts/SomeFont-Regular.woff
还有这个:
OTS parsing error: invalid version tag
OTS parsing error: invalid version tag
我在网上搜索了这个问题,没有找到,或者一些相关情况
【问题讨论】:
标签: vue.js webpack fonts sass webfonts