Browse Source

fix: 修复cell

zhenyulei 5 years ago
parent
commit
7c3a892ab9
2 changed files with 29 additions and 33 deletions
  1. 4 8
      src/packages/cell/cell.scss
  2. 25 25
      src/packages/cell/cell.vue

+ 4 - 8
src/packages/cell/cell.scss

@@ -20,14 +20,14 @@
 			justify-content: space-between;
 			// min-height: 48px;
 			// @include nut-cell-border;
-			.nut-icon {
-				margin-right: 13px;
-			}
+			// .nut-icon {
+			// 	margin-right: 13px;
+			// }
 		}
-
 		.nut-cell-left {
 			flex: 1;
 			flex-direction: column;
+			margin-left: 13px;
 		}
 
 		.nut-cell-title {
@@ -90,8 +90,4 @@
 	&:last-child .nut-cell {
 		border-bottom: none;
 	}
-
-	&:only-of-type {
-		border-bottom: none;
-	}
 }

+ 25 - 25
src/packages/cell/cell.vue

@@ -1,32 +1,32 @@
 <template>
   <div class="wrapper-cell">
-  <a :class="['nut-cell', { 'nut-cell-link': isLink }]" :href="linkUrl" :style="{ 'background-color': bgColor }" :target="target" @click="jumpPage">
-    <div class="nut-cell-box" @click="clickCell">
-      <slot name="avatar"></slot>
-      <div class="nut-cell-left">
-        <span class="nut-cell-title"
-          ><slot name="title">{{ title }}</slot></span
-        >
-        <span class="nut-cell-sub-title"
+    <a :class="['nut-cell', { 'nut-cell-link': isLink }]" :href="linkUrl" :style="{ 'background-color': bgColor }" :target="target" @click="jumpPage">
+      <div class="nut-cell-box" @click="clickCell">
+        <slot name="avatar"></slot>
+        <div class="nut-cell-left">
+          <span class="nut-cell-title"
+            ><slot name="title">{{ title }}</slot></span
           >
-          <slot name="sub-title">
-            <template>{{ subTitle.substring(0,12) }}</template>
-            <template v-if="subTitle.length>12">...</template>
-          </slot></span
-        >
-      </div>
-      <div class="nut-cell-right">
-        <span class="nut-cell-desc"
-          ><slot name="desc">{{ desc }}</slot></span
-        >
-        <span class="nut-cell-icon">
-          <slot name="icon" v-if="showIcon">
-            <nut-icon type="right" size="15px" color="#848484"></nut-icon>
-          </slot>
-        </span>
+          <span class="nut-cell-sub-title"
+            >
+            <slot name="sub-title">
+              <template>{{ subTitle.substring(0,12) }}</template>
+              <template v-if="subTitle.length>12">...</template>
+            </slot></span
+          >
+        </div>
+        <div class="nut-cell-right">
+          <span class="nut-cell-desc"
+            ><slot name="desc">{{ desc }}</slot></span
+          >
+          <span class="nut-cell-icon">
+            <slot name="icon" v-if="showIcon">
+              <nut-icon type="right" size="11px" color="#848484"></nut-icon>
+            </slot>
+          </span>
+        </div>
       </div>
-    </div>
-  </a>
+    </a>
   </div>
 </template>
 <script>