Переглянути джерело

屏幕大小实时变化的兼容性问题

黄琪勇 1 рік тому
батько
коміт
5cd23d0b20

+ 3 - 2
src/views/creation/index-share.tsx

@@ -465,7 +465,8 @@ export default defineComponent({
       <div
         style={
           {
-            '--barheight':state.heightV + "px"
+            '--barheight':state.heightV + "px",
+            "--creationHeight":creationHeight.value ? creationHeight.value+"px" : "100vh"
           }
         }
         class={[
@@ -473,7 +474,7 @@ export default defineComponent({
           browser().isTablet ? styles.creationTablet : '',
           isScreenScroll.value && styles.isShareScreenScroll
         ]}>
-        <div style={ creationHeight.value ? {"--creationHeight":creationHeight.value + "px"} : {}} class={styles.creationBg}></div>
+        <div class={styles.creationBg}></div>
         <MSticky position="top"
           onBarHeight={(height: any) => {
             console.log(height, 'height', height)

+ 2 - 1
src/views/creation/index.module.less

@@ -617,7 +617,8 @@
   right: 0;
   bottom: 0;
   width: 100vw;
-  height: 100vh;
+  height: var(--creationHeight, 100vh);
+  min-height: 100vh;
   display: flex;
   flex-direction: column;
   justify-content: center;