chore: use gen instead of render (#4922)
This commit is contained in:
@@ -45,7 +45,7 @@ function AddressItem(
|
||||
emit(ctx, 'click');
|
||||
}
|
||||
|
||||
const renderRightIcon = () => (
|
||||
const genRightIcon = () => (
|
||||
<Icon
|
||||
name="edit"
|
||||
class={bem('edit')}
|
||||
@@ -57,7 +57,7 @@ function AddressItem(
|
||||
/>
|
||||
);
|
||||
|
||||
const renderContent = () => {
|
||||
const genContent = () => {
|
||||
const { data } = props;
|
||||
const Info = [
|
||||
<div class={bem('name')}>{`${data.name},${data.tel}`}</div>,
|
||||
@@ -79,8 +79,8 @@ function AddressItem(
|
||||
valueClass={bem('value')}
|
||||
clickable={switchable && !disabled}
|
||||
scopedSlots={{
|
||||
default: renderContent,
|
||||
'right-icon': renderRightIcon
|
||||
default: genContent,
|
||||
'right-icon': genRightIcon
|
||||
}}
|
||||
onClick={onClick}
|
||||
{...inherit(ctx)}
|
||||
|
||||
@@ -29,7 +29,7 @@ function AddressList(
|
||||
slots: AddressListSlots,
|
||||
ctx: RenderContext<AddressListProps>
|
||||
) {
|
||||
function renderList(list?: AddressItemData[], disabled?: boolean) {
|
||||
function genList(list?: AddressItemData[], disabled?: boolean) {
|
||||
if (!list) {
|
||||
return;
|
||||
}
|
||||
@@ -57,8 +57,8 @@ function AddressList(
|
||||
));
|
||||
}
|
||||
|
||||
const List = renderList(props.list);
|
||||
const DisabledList = renderList(props.disabledList, true);
|
||||
const List = genList(props.list);
|
||||
const DisabledList = genList(props.disabledList, true);
|
||||
|
||||
return (
|
||||
<div class={bem()} {...inherit(ctx)}>
|
||||
|
||||
Reference in New Issue
Block a user