vue-cli3引入外部字体和使用方法
1.在style里面放入外部的文字文件
2.在style的index.scss文件中引入以下需要用到的文字字体
<style>
@font-face {
font-family: "fangzhenglanting";
src: url(./fonts/BankGothic-Regular.ttf) format("truetype");
}
@font-face {
font-family: 'ds-digitalnormal';
src: url('./fonts/ds-digital_normal-webfont.woff2') format('woff2'),
url('./fonts/ds-digital_normal-webfont.woff') format('woff');
font-weight: normal;
font-style: normal;
}
</style>
3.在main.js文件下引入全局样式index.scss
4.就可以在需要的地方引入字体
展现如下: