Commit d7636299 by zsh

修改缩放设置

parent e2b51a1c
Subproject commit d23c1ed387a5099f276d4b2da2fbed7f4e005715
Subproject commit 915d12331a8812ea20cfa24531d9245dfa8d8179
......@@ -11,18 +11,30 @@ export default {
name: 'app',
data () {
return {}
return {
designWidth: 3840, // 设计稿宽度
designHeight: 2160 // 设计稿高度
}
},
mounted () {
// 如无需设置自动适配则注释该方法即可
this.initScale()
},
methods: {
/**
* @method initScale 设置页面缩放事件
*/
initScale () {
refreshScale()
window.addEventListener('resize', refreshScale)
const appStyle = document.getElementById('app').style
appStyle.position = 'fixed'
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