Commit d7636299 by zsh

修改缩放设置

parent e2b51a1c
Subproject commit d23c1ed387a5099f276d4b2da2fbed7f4e005715 Subproject commit 915d12331a8812ea20cfa24531d9245dfa8d8179
...@@ -11,18 +11,30 @@ export default { ...@@ -11,18 +11,30 @@ export default {
name: 'app', name: 'app',
data () { data () {
return {} return {
designWidth: 3840, // 设计稿宽度
designHeight: 2160 // 设计稿高度
}
}, },
mounted () { mounted () {
// 如无需设置自动适配则注释该方法即可
this.initScale() this.initScale()
}, },
methods: { methods: {
/**
* @method initScale 设置页面缩放事件
*/
initScale () { initScale () {
refreshScale() const appStyle = document.getElementById('app').style
appStyle.position = 'fixed'
window.addEventListener('resize', refreshScale) refreshScale(this.designWidth, this.designHeight)
// 窗口缩放时重新做适配
window.addEventListener('resize', () => {
refreshScale(this.designWidth, this.designHeight)
}, false)
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment