-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathApp.vue
45 lines (41 loc) · 839 Bytes
/
App.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
<div id="app" style="height:100%;">
<!--default slot-->
<router-view></router-view>
</div>
</template>
<script>
export default {
components: {},
data () {
return {}
},
beforeMount () {
this.initBaseFontSize()
},
mounted () {
let _this = this
window.onresize = function () {
_this.initBaseFontSize()
}
},
computed: {},
methods: {
/**
* 根据屏幕宽度计算html基准的font-size
*/
initBaseFontSize () {
let _width = document.documentElement.clientWidth * 20 / 1280
_width = _width > 27 ? 27 : _width
document.documentElement.style.fontSize = `${_width}px`
}
}
}
</script>
<style lang="less" rel="stylesheet/less">
#nprogress .spinner {
display: none;
}
@import "styles/icon.css";
@import "./styles/index.scss";
</style>