Browse Source

fix: 加了layout后,要把page样式挪到layout根元素上

Burt 2 năm trước cách đây
mục cha
commit
cb332d447e

+ 20 - 1
src/layouts/default.vue

@@ -1,3 +1,22 @@
 <template>
-  <slot />
+  <view class="default-layout">
+    <slot />
+  </view>
 </template>
+
+<style lang="scss">
+.default-layout {
+  display: flex;
+  flex-direction: column;
+
+  // #ifdef MP-WEIXIN
+  height: 100%;
+
+  // #endif
+  // #ifndef MP-WEIXIN
+  min-height: 100%;
+
+  // #endif
+  overflow: hidden;
+}
+</style>

+ 0 - 15
src/pages/demo/demo/throughout.vue

@@ -94,21 +94,6 @@ const onRefresherRefresh = async () => {
 </script>
 
 <style lang="scss">
-page {
-  display: flex;
-  flex-direction: column;
-
-  // #ifdef MP-WEIXIN
-  height: 100%;
-
-  // #endif
-  // #ifndef MP-WEIXIN
-  min-height: 100%;
-
-  // #endif
-  overflow: hidden;
-}
-
 .scroll-view-bg {
   // 这个背景色要与.top-section的背景图差不多,这样下拉刷新看起来才比较协调
   background-color: #23c09c;

+ 0 - 15
src/pages/demo/demo/throughout/index.vue

@@ -100,21 +100,6 @@ const onRefresherRefresh = async () => {
 </script>
 
 <style lang="scss">
-page {
-  display: flex;
-  flex-direction: column;
-
-  // #ifdef MP-WEIXIN
-  height: 100%;
-
-  // #endif
-  // #ifndef MP-WEIXIN
-  min-height: 100%;
-
-  // #endif
-  overflow: hidden;
-}
-
 .scroll-view-bg {
   // 这个背景色要与.top-section的背景图差不多,这样下拉刷新看起来才比较协调
   background-color: #23c09c;