[bugfix] AddressList: should hide radio of disabled item (#2687)

This commit is contained in:
neverland 2019-02-05 21:55:02 +08:00 committed by GitHub
parent 6d2eeec237
commit 1ea92c023c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 8 deletions

View File

@ -22,16 +22,18 @@ export default sfc({
render(h) {
const { data, disabled, switchable } = this;
const Info = [
<div class={bem('name')}>{`${data.name}${data.tel}`}</div>,
<div class={bem('address')}>{data.address}</div>
];
return (
<Cell
class={bem({ disabled, unswitchable: !switchable })}
isLink={!disabled && switchable}
onClick={this.onSelect}
>
<Radio name={data.id}>
<div class={bem('name')}>{`${data.name}${data.tel}`}</div>
<div class={bem('address')}>{data.address}</div>
</Radio>
{disabled ? Info : <Radio name={data.id}>{Info}</Radio>}
<Icon
slot="right-icon"
name="edit"

View File

@ -27,10 +27,8 @@ exports[`renders demo correctly 1`] = `
<div class="van-address-list__disabled-text">以下地址超出配送范围</div>
<div class="van-cell van-address-item van-address-item--disabled van-address-item--unswitchable">
<div class="van-cell__value van-cell__value--alone">
<div class="van-radio">
<div class="van-radio__icon van-radio__icon--round"><i class="van-icon van-icon-success">
<!----></i></div><span class="van-radio__label"><div class="van-address-item__name">王五1320000000</div><div class="van-address-item__address">浙江省杭州市滨江区江南大道 15 号</div></span>
</div>
<div class="van-address-item__name">王五1320000000</div>
<div class="van-address-item__address">浙江省杭州市滨江区江南大道 15 号</div>
</div><i class="van-icon van-icon-edit van-address-item__edit">
<!----></i>
</div><button class="van-button van-button--danger van-button--large van-button--square van-address-list__add"><span class="van-button__text">新增地址</span></button>