写到assets内的font.js内
@font-face {
font-family: "Bold";
src: url('SourceHanSans-Bold.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "ExtraLight";
src: url('SourceHanSans-ExtraLight.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Heavy";
src: url('SourceHanSans-Heavy.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Light";
src: url('SourceHanSans-Light.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Medium";
src: url('SourceHanSans-Medium.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Normal";
src: url('SourceHanSans-Normal.otf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: "Regular";
src: url('SourceHanSans-Regular.otf');
font-weight: normal;
font-style: normal;
}
在mian.js内引入
import "./assets/common/iconfont.css"