src
文件夹里面新建assets
文件夹asstes
文件夹里面新建css
文件夹css
文件夹里面新建mixin.scss
和reset.scss
,以下图app.vue
的mounted里面写mounted(){
// 设置html的font-size
document.addEventListener("DOMContentLoaded", function() {
const html = document.querySelector("html");
html.style.fontSize = window.innerWidth / 10 + "px";
});
}
复制代码
哪一个页面须要,就在哪一个页面引入reset.scss
css
<style lang="scss" scoped>
@import "../assets/css/reset.scss";
.status {
position: absolute;
width: rem(690);
left: 5%;
top: 3%;
}
</style>
复制代码
assets源码连接html