zhengnaiwen_citu 4 meses atrás
pai
commit
a93e0f0a5e
1 arquivos alterados com 4 adições e 1 exclusões
  1. 4 1
      src/views/Home.vue

+ 4 - 1
src/views/Home.vue

@@ -1,5 +1,6 @@
 <template>
   <div class="home">
+    {{ CLIENT_WIDTH }}-{{ CLIENT_HEIGHT }}
     <section>
       <MCover :width="width">
         <template #center="{ active, target }">
@@ -47,6 +48,7 @@ import MCamera from './components/MCamera'
 import MFeature from './components/MFeature'
 import MTry from './components/MTry'
 const CLIENT_WIDTH = window.innerWidth < 480 ? window.innerWidth : 480
+const CLIENT_HEIGHT = window.innerWidth < 480 ? window.innerWidth / 480 * 640 : 640
 export default {
   name: 'home-view',
   components: {
@@ -58,12 +60,13 @@ export default {
   provide: {
     size: {
       width: CLIENT_WIDTH,
-      height: window.innerWidth < 480 ? window.innerWidth / 480 * 640 : 640
+      height: CLIENT_HEIGHT
     }
   },
   data () {
     return {
       CLIENT_WIDTH,
+      CLIENT_HEIGHT,
       imgBase64: '',
       tab: 0,
       width: `${CLIENT_WIDTH}px`,