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

View File

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