From 605e281a77fbddfbb7970f841dd5bcc2b1aea9eb Mon Sep 17 00:00:00 2001
From: Tevin <tingquanren@163.com>
Date: Tue, 30 Aug 2022 18:28:47 +0800
Subject: [PATCH] 页面基础组件,增加Y轴滚动的功能

---
 layout/h5Page/CContent.vue |   21 ++++++++++++++++++++-
 layout/h5Page/cPage.scss   |    3 +++
 common/custom.scss         |    1 +
 3 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/common/custom.scss b/common/custom.scss
index c9995e2..50e39a7 100644
--- a/common/custom.scss
+++ b/common/custom.scss
@@ -75,6 +75,7 @@
                 box-sizing: border-box;
                 .layout-header__title {
                     font-size: 38px;
+                    line-height: 46px;
                 }
             }
             .layout-body {
diff --git a/layout/h5Page/CContent.vue b/layout/h5Page/CContent.vue
index 775f77c..6f4b89e 100644
--- a/layout/h5Page/CContent.vue
+++ b/layout/h5Page/CContent.vue
@@ -5,12 +5,31 @@
  
 <template>
     <view class="c-content">
-        <slot />
+        <view
+            class="c-content-inner"
+            v-if="scroll==='off'"
+        >
+            <slot />
+        </view>
+        <scroll-view
+            class="c-content-scroll"
+            v-if="scroll==='on'"
+            :scrollY="true"
+        >
+            <slot />
+        </scroll-view>
     </view>
 </template>
 
 <script>
 export default {
     name: 'CContent',
+    props: {
+        // 开启滚动,off / on
+        scroll: {
+            type: String,
+            default: 'off',
+        },
+    },
 };
 </script>
\ No newline at end of file
diff --git a/layout/h5Page/cPage.scss b/layout/h5Page/cPage.scss
index d60b4b5..2ac3d1a 100644
--- a/layout/h5Page/cPage.scss
+++ b/layout/h5Page/cPage.scss
@@ -19,5 +19,8 @@
         width: 100%;
         height: 100%;
         overflow: hidden;
+        .c-content-scroll {
+            height: 100%;
+        }
     }
 }
\ No newline at end of file

--
Gitblit v1.9.1