Browse Source

fix(swiper): 当只有一张图时,高度超出css设置的值(#1109)

suzigang 3 years ago
parent
commit
3d3d846140

+ 2 - 7
src/packages/__VUE/swiper/demo.vue

@@ -2,12 +2,7 @@
   <div class="demo">
   <div class="demo">
     <h2>基本用法</h2>
     <h2>基本用法</h2>
     <view class="demo-box">
     <view class="demo-box">
-      <nut-swiper
-        :init-page="page"
-        :pagination-visible="true"
-        pagination-color="#426543"
-        auto-play="2000"
-      >
+      <nut-swiper :init-page="page" :pagination-visible="true" pagination-color="#426543" auto-play="2000">
         <nut-swiper-item v-for="item in list" :key="item">
         <nut-swiper-item v-for="item in list" :key="item">
           <img :src="item" alt="" />
           <img :src="item" alt="" />
         </nut-swiper-item>
         </nut-swiper-item>
@@ -85,7 +80,7 @@ export default createDemo({
 <style lang="scss" scoped>
 <style lang="scss" scoped>
 .demo-box {
 .demo-box {
   .nut-swiper-item {
   .nut-swiper-item {
-    line-height: 150px;
+    height: 150px;
     img {
     img {
       width: 100%;
       width: 100%;
       height: 100%;
       height: 100%;

+ 1 - 1
src/sites/mobile-taro/vue/src/feedback/pages/swiper/index.vue

@@ -79,7 +79,7 @@ export default {
 <style lang="scss">
 <style lang="scss">
 .demo-box {
 .demo-box {
   .nut-swiper-item {
   .nut-swiper-item {
-    line-height: 150px;
+    height: 150px;
     img {
     img {
       width: 100%;
       width: 100%;
       height: 100%;
       height: 100%;