mirror of
				https://gitee.com/vant-contrib/vant-weapp.git
				synced 2025-10-27 01:42:08 +08:00 
			
		
		
		
	fix(Çard): 修复centered属性无效,去除title、desc长度限制 @rex-zsd (#1270)
This commit is contained in:
		
							parent
							
								
									13e00d9de3
								
							
						
					
					
						commit
						0c4a5baff5
					
				| @ -8,13 +8,13 @@ | |||||||
|   background-color: @background-color-light; |   background-color: @background-color-light; | ||||||
|   box-sizing: border-box; |   box-sizing: border-box; | ||||||
| 
 | 
 | ||||||
|   &--center { |  | ||||||
|     align-items: center; |  | ||||||
|     justify-content: center; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   &__header { |   &__header { | ||||||
|     display: flex; |     display: flex; | ||||||
|  | 
 | ||||||
|  |     &--center { | ||||||
|  |       align-items: center; | ||||||
|  |       justify-content: center; | ||||||
|  |     } | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   &__thumb { |   &__thumb { | ||||||
| @ -36,7 +36,6 @@ | |||||||
| 
 | 
 | ||||||
|   &__content { |   &__content { | ||||||
|     position: relative; |     position: relative; | ||||||
|     height: 90px; |  | ||||||
|     min-width: 0; /* hack for flex box ellipsis */ |     min-width: 0; /* hack for flex box ellipsis */ | ||||||
|     flex: 1; |     flex: 1; | ||||||
|   } |   } | ||||||
| @ -47,13 +46,11 @@ | |||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   &__title { |   &__title { | ||||||
|     max-height: 32px; |  | ||||||
|     font-weight: bold; |     font-weight: bold; | ||||||
|     line-height: 16px; |     line-height: 16px; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   &__desc { |   &__desc { | ||||||
|     max-height: 20px; |  | ||||||
|     line-height: 20px; |     line-height: 20px; | ||||||
|     color: @gray-darker; |     color: @gray-darker; | ||||||
|   } |   } | ||||||
|  | |||||||
| @ -1,5 +1,7 @@ | |||||||
| <view class="custom-class van-card {{ centered ? 'van-card--center' : '' }}"> | <wxs src="../wxs/utils.wxs" module="utils" /> | ||||||
|   <view class="van-card__header"> | 
 | ||||||
|  | <view class="custom-class van-card"> | ||||||
|  |   <view class="{{ utils.bem('card__header', { center: centered }) }}"> | ||||||
|     <view class="van-card__thumb" bind:tap="onClickThumb"> |     <view class="van-card__thumb" bind:tap="onClickThumb"> | ||||||
|       <image |       <image | ||||||
|         wx:if="{{ thumb }}" |         wx:if="{{ thumb }}" | ||||||
| @ -20,10 +22,10 @@ | |||||||
|     </view> |     </view> | ||||||
| 
 | 
 | ||||||
|     <view class="van-card__content"> |     <view class="van-card__content"> | ||||||
|       <view wx:if="{{ title }}" class="van-card__title van-multi-ellipsis--l2 title-class">{{ title }}</view> |       <view wx:if="{{ title }}" class="van-card__title title-class">{{ title }}</view> | ||||||
|       <slot wx:else name="title" /> |       <slot wx:else name="title" /> | ||||||
| 
 | 
 | ||||||
|       <view wx:if="{{ desc }}" class="van-card__desc van-ellipsis desc-class">{{ desc }}</view> |       <view wx:if="{{ desc }}" class="van-card__desc desc-class">{{ desc }}</view> | ||||||
|       <slot wx:else name="desc" /> |       <slot wx:else name="desc" /> | ||||||
| 
 | 
 | ||||||
|       <slot name="tags" /> |       <slot name="tags" /> | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user