[bugfix] AddressList: select-disabled event not triggered

This commit is contained in:
陈嘉涵 2019-05-23 21:03:13 +08:00
parent 75e91347c6
commit 32dbb7904b
2 changed files with 6 additions and 6 deletions

View File

@ -36,11 +36,11 @@ function AddressItem(
) { ) {
const { disabled, switchable } = props; const { disabled, switchable } = props;
const onSelect = () => { function onSelect() {
if (props.switchable) { if (switchable) {
emit(ctx, 'select'); emit(ctx, 'select');
} }
}; }
const renderRightIcon = () => ( const renderRightIcon = () => (
<Icon <Icon
@ -60,7 +60,7 @@ function AddressItem(
<div class={bem('address')}>{data.address}</div> <div class={bem('address')}>{data.address}</div>
]; ];
return props.switchable ? ( return switchable && !disabled ? (
<Radio name={data.id} onClick={onSelect}> <Radio name={data.id} onClick={onSelect}>
{Info} {Info}
</Radio> </Radio>
@ -73,7 +73,7 @@ function AddressItem(
<Cell <Cell
class={bem({ disabled, unswitchable: !switchable })} class={bem({ disabled, unswitchable: !switchable })}
valueClass={bem('value')} valueClass={bem('value')}
isLink={!disabled && switchable} clickable={switchable && !disabled}
scopedSlots={{ scopedSlots={{
default: renderContent, default: renderContent,
'right-icon': renderRightIcon 'right-icon': renderRightIcon

View File

@ -35,7 +35,7 @@ function AddressList(
data={item} data={item}
key={item.id} key={item.id}
disabled={disabled} disabled={disabled}
switchable={props.switchable && !disabled} switchable={props.switchable}
onSelect={() => { onSelect={() => {
emit(ctx, disabled ? 'select-disabled' : 'select', item, index); emit(ctx, disabled ? 'select-disabled' : 'select', item, index);
}} }}