mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(AddressList): incorrect tel when isDefault is 0 (#5232)
This commit is contained in:
parent
a047717016
commit
2fd4f393b1
@ -60,28 +60,36 @@ function AddressItem(
|
|||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|
||||||
const genContent = () => {
|
function genTag() {
|
||||||
|
if (props.data.isDefault && props.defaultTagText) {
|
||||||
|
return (
|
||||||
|
<Tag type="danger" round class={bem('tag')}>
|
||||||
|
{props.defaultTagText}
|
||||||
|
</Tag>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function genContent() {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
const Info = [
|
const Info = [
|
||||||
<div class={bem('name')}>
|
<div class={bem('name')}>
|
||||||
{`${data.name} ${data.tel}`}
|
{`${data.name} ${data.tel}`}
|
||||||
{data.isDefault && props.defaultTagText && (
|
{genTag()}
|
||||||
<Tag type="danger" round class={bem('tag')}>
|
|
||||||
{props.defaultTagText}
|
|
||||||
</Tag>
|
|
||||||
)}
|
|
||||||
</div>,
|
</div>,
|
||||||
<div class={bem('address')}>{data.address}</div>
|
<div class={bem('address')}>{data.address}</div>
|
||||||
];
|
];
|
||||||
|
|
||||||
return switchable && !disabled ? (
|
if (switchable && !disabled) {
|
||||||
|
return (
|
||||||
<Radio name={data.id} iconSize={16}>
|
<Radio name={data.id} iconSize={16}>
|
||||||
{Info}
|
{Info}
|
||||||
</Radio>
|
</Radio>
|
||||||
) : (
|
|
||||||
Info
|
|
||||||
);
|
);
|
||||||
};
|
}
|
||||||
|
|
||||||
|
return Info;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Cell
|
<Cell
|
||||||
@ -106,4 +114,6 @@ AddressItem.props = {
|
|||||||
defaultTagText: String
|
defaultTagText: String
|
||||||
};
|
};
|
||||||
|
|
||||||
export default createComponent<AddressItemProps, AddressItemEvents>(AddressItem);
|
export default createComponent<AddressItemProps, AddressItemEvents>(
|
||||||
|
AddressItem
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user