Jelajahi Sumber

默认只展示两个,添加箭头展开全部和收起

lifanagju_citu 23 jam lalu
induk
melakukan
2021abbe1a
1 mengubah file dengan 18 tambahan dan 2 penghapusan
  1. 18 2
      pages/index/components/talentItem.vue

+ 18 - 2
pages/index/components/talentItem.vue

@@ -60,7 +60,13 @@
 						</view>
 					</template>
 				</view>
-				<view v-if="val.workList.length > 2" class="showBtn color-primary" @tap.stop="val.showAll = Boolean(!val.showAll)">{{ val.showAll ? '收起' : '展开全部' }}</view>
+				<view v-if="val.workList.length > 2" class="showBtn color-primary" @tap.stop="val.showAll = Boolean(!val.showAll)">
+					{{ val.showAll ? '收起' : '展开全部' }}
+					<view class="icons">
+						<uni-icons class="icon" :type="val.showAll ? 'up' : 'down'" color="#008BB7" size="12" />
+						<uni-icons class="icon" :type="val.showAll ? 'up' : 'down'" color="#008BB7" size="12" />
+					</view>
+				</view>
 			</view>
 		</view>
 	</view>
@@ -123,6 +129,16 @@ const handleDetail = ({ userId }) => {
 	}
 }
 .showBtn {
-	text-align: center;
+	display: flex;
+	justify-content: center;
+	align-items: center;
+	.icons {
+		display: flex;
+		flex-direction: column;
+		margin-left: 5px;
+		.icon {
+			line-height: 4px;
+		}
+	}
 }
 </style>