1、将字体的包体存入在static文件夹下

2、在app.js中引入

@font-face {
     font-family: my-font;
	 src: url('~@/static/Times New Roman.ttf');
}

3、最后在页面中正常使用就行了

.content {
    overflow: hidden;
	position: relative;
	background: url(../../static/bg.png);
	background-size: 100% 100%;
	width: 100vw;
	height:calc(1080px - 143px);
	font-family:Times New Roman;
	margin: 0 auto;
 }

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐