feat(Skeleton): add new external class row-class & avatar-class & title-class (#2612)

fix #2580
This commit is contained in:
rex 2019-12-27 14:44:39 +08:00 committed by GitHub
parent a59ea40115
commit d798f4d87f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View File

@ -1,6 +1,7 @@
import { VantComponent } from '../common/component';
VantComponent({
classes: ['avatar-class', 'title-class', 'row-class'],
props: {
row: {
type: Number,

View File

@ -6,20 +6,20 @@
>
<view
wx:if="{{ avatar }}"
class="{{ utils.bem('skeleton__avatar', [avatarShape])}}"
class="avatar-class {{ utils.bem('skeleton__avatar', [avatarShape])}}"
style="{{ 'width:' + avatarSize + ';height:' + avatarSize }}"
/>
<view class="{{ utils.bem('skeleton__content')}}">
<view
wx:if="{{ title }}"
class="{{ utils.bem('skeleton__title') }}"
class="title-class {{ utils.bem('skeleton__title') }}"
style="{{ 'width:' + titleWidth }}"
/>
<view
wx:for="{{ row }}"
wx:key="index"
wx:for-index="index"
class="{{ utils.bem('skeleton__row') }}"
class="row-class {{ utils.bem('skeleton__row') }}"
style="{{ 'width:' + (isArray ? rowWidth[index] : rowWidth) }}"
/>
</view>