mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] AddressList: should hide radio of disabled item (#2687)
This commit is contained in:
parent
6d2eeec237
commit
1ea92c023c
@ -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"
|
||||
|
@ -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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user