[bugfix] Cell: wrong tag

This commit is contained in:
陈嘉涵 2018-08-01 12:01:40 +08:00
parent b9f6b1f6ed
commit 6ff8676fa5
7 changed files with 18 additions and 23 deletions

View File

@ -59,7 +59,6 @@ module.exports = {
field: require('./packages/field/README.md'), field: require('./packages/field/README.md'),
radio: require('./packages/radio/README.md'), radio: require('./packages/radio/README.md'),
search: require('./packages/search/README.md'), search: require('./packages/search/README.md'),
select: require('./packages/select/README.md'),
stepper: require('./packages/stepper/README.md'), stepper: require('./packages/stepper/README.md'),
switch: require('./packages/switch/README.md') switch: require('./packages/switch/README.md')
} }

View File

@ -35,10 +35,10 @@
thumb="{{ imageURL }}" thumb="{{ imageURL }}"
use-footer-slot="{{ true }}" use-footer-slot="{{ true }}"
> >
<div slot="footer"> <view slot="footer">
<van-button size="mini">按钮</van-button> <van-button size="mini">按钮</van-button>
<van-button size="mini">按钮</van-button> <van-button size="mini">按钮</van-button>
</div> </view>
</van-card> </van-card>
``` ```

View File

@ -14,12 +14,12 @@
#### 基础用法 #### 基础用法
`van-cell-group`组件看成一个容器即可 `cell-group`组件是承载`cell`组件的容器,对于容器中的最后一个 cell需要将 border 属性设置成 `false`
```html ```html
<van-cell-group> <van-cell-group>
<van-cell title="单元格" value="内容" /> <van-cell title="单元格" value="内容" />
<van-cell title="单元格" value="内容" label="描述信息" /> <van-cell title="单元格" value="内容" label="描述信息" border="{{ false }}" />
</van-cell-group> </van-cell-group>
``` ```
@ -28,7 +28,7 @@
```html ```html
<van-cell-group> <van-cell-group>
<van-cell value="内容" /> <van-cell value="内容" border="{{ false }}" />
</van-cell-group> </van-cell-group>
``` ```
@ -37,7 +37,7 @@
```html ```html
<van-cell-group> <van-cell-group>
<van-cell title="单元格" icon="location" /> <van-cell title="单元格" icon="location" border="{{ false }}" />
</van-cell-group> </van-cell-group>
``` ```
@ -54,6 +54,7 @@
is-link is-link
arrow-direction="down" arrow-direction="down"
value="内容" value="内容"
border="{{ false }}"
url="/pages/dashboard/index" url="/pages/dashboard/index"
/> />
</van-cell-group> </van-cell-group>
@ -71,7 +72,7 @@
</template> </template>
</van-cell> </van-cell>
<van-cell title="单元格" icon="location" is-link /> <van-cell title="单元格" icon="location" is-link />
<van-cell title="单元格"> <van-cell title="单元格" border="{{ false }}">
<van-icon slot="right-icon" name="search" class="van-cell__right-icon" /> <van-icon slot="right-icon" name="search" class="van-cell__right-icon" />
</van-cell> </van-cell>
</van-cell-group> </van-cell-group>

View File

@ -22,6 +22,7 @@ Component({
isLink: Boolean, isLink: Boolean,
required: Boolean, required: Boolean,
clickable: Boolean, clickable: Boolean,
titleWidth: String,
arrowDirection: String, arrowDirection: String,
linkType: { linkType: {
type: String, type: String,

View File

@ -1,9 +1,5 @@
@import '../helper/index.pcss'; @import '../helper/index.pcss';
:host:last-child {
background-color: red;
}
.van-cell { .van-cell {
width: 100%; width: 100%;
display: flex; display: flex;

View File

@ -1,17 +1,15 @@
<div <view
class="custom-class van-cell {{ center ? 'van-cell--center' : '' }} {{ required ? 'van-cell--required' : '' }} {{ isLink || clickable ? 'van-cell--clickable' : '' }} {{ border ? 'van-hairline' : '' }}" class="custom-class van-cell {{ center ? 'van-cell--center' : '' }} {{ required ? 'van-cell--required' : '' }} {{ isLink || clickable ? 'van-cell--clickable' : '' }} {{ border ? 'van-hairline' : '' }}"
bind:tap="onTap" bind:tap="onTap"
> >
<van-icon wx:if="icon" custom-class="van-cell__left-icon left-icon-class" name="{{ icon }}" /> <van-icon wx:if="{{ icon }}" custom-class="van-cell__left-icon left-icon-class" name="{{ icon }}" />
<slot wx:else name="icon" /> <slot wx:else name="icon" />
<view wx:if="{{ title }}" class="van-cell__title title-class"> <view wx:if="{{ title }}" class="van-cell__title title-class" style="{{ titleWidth ? 'max-width: ' + titleWidth : '' }}">
{{ title }} {{ title }}
<view wx:if="{{ label }}" class="van-cell__label label-class">{{ label }}</view> <view wx:if="{{ label }}" class="van-cell__label label-class">{{ label }}</view>
</view> </view>
<view wx:else class="van-cell__title title-class"> <slot name="title" />
<slot name="title" />
</view>
<view class="van-cell__value value-class"> <view class="van-cell__value value-class">
<view wx:if="{{ value }}">{{ value }}</view> <view wx:if="{{ value }}">{{ value }}</view>
@ -26,4 +24,4 @@
<slot wx:else name="right-icon" /> <slot wx:else name="right-icon" />
<slot name="extra" /> <slot name="extra" />
</div> </view>

View File

@ -1,9 +1,9 @@
<div <view
class="van-switch custom-class {{ checked ? 'van-switch--on' : '' }} {{ disabled ? 'van-switch--disabled' : '' }}" class="van-switch custom-class {{ checked ? 'van-switch--on' : '' }} {{ disabled ? 'van-switch--disabled' : '' }}"
style="font-size: {{ size }};" style="font-size: {{ size }};"
bind:tap="onClick" bind:tap="onClick"
> >
<div class="van-switch__node node-class"> <view class="van-switch__node node-class">
<van-loading wx:if="{{ loading }}" size="50%" custom-class="van-switch__loading" /> <van-loading wx:if="{{ loading }}" size="50%" custom-class="van-switch__loading" />
</div> </view>
</div> </view>