From 44280203af25006efc4b8939b4fc01477041e9b8 Mon Sep 17 00:00:00 2001 From: wangrui <zephyrs0894@163.com> Date: 星期六, 19 十二月 2020 01:01:47 +0800 Subject: [PATCH] 重构基础图层加载的代码 --- src/App.vue | 17 ++++++++++++++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index 3061c15..010714e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,19 +1,28 @@ <template> - <div id="app"> + <div id="app" ref="app"> <map-template></map-template> </div> </template> <script> import MapTemplate from './views/MapTemplate.vue' + export default { name: 'App', - components: {MapTemplate} + components: {MapTemplate}, + mounted(){ + this.$nextTick(()=>{ + let h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; //娴忚鍣ㄩ珮搴� + let topH = this.$refs.app.offsetHeight; + console.log(h) + this.height = (h - topH) + "px" + }) + } } </script> <style> -#app { +html,body,#app { font-family: Avenir, Helvetica, Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -21,5 +30,7 @@ color: #2c3e50; padding: 0px; margin: 0px; + + text-align: left; } </style> -- Gitblit v1.8.0