diff --git a/packages/address-list/Item.tsx b/packages/address-list/Item.tsx index a3ddeab34..f7c134a96 100644 --- a/packages/address-list/Item.tsx +++ b/packages/address-list/Item.tsx @@ -36,11 +36,11 @@ function AddressItem( ) { const { disabled, switchable } = props; - const onSelect = () => { + function onSelect() { if (props.switchable) { emit(ctx, 'select'); } - }; + } const renderRightIcon = () => ( { + function onClick(event: Event) { if (!loading && !disabled) { emit(ctx, 'click', event); functionalRoute(ctx); } - }; + } - const onTouchstart = (event: TouchEvent) => { + function onTouchstart(event: TouchEvent) { emit(ctx, 'touchstart', event); - }; + } const classes = [ bem([ diff --git a/packages/cell/index.tsx b/packages/cell/index.tsx index 325f23462..6bf923b44 100644 --- a/packages/cell/index.tsx +++ b/packages/cell/index.tsx @@ -74,10 +74,10 @@ function Cell( /> ); - const onClick = (event: Event) => { + function onClick(event: Event) { emit(ctx, 'click', event); functionalRoute(ctx); - }; + } const classes: Mods = { center: props.center, diff --git a/packages/contact-card/index.tsx b/packages/contact-card/index.tsx index bfec063c8..83ef53572 100644 --- a/packages/contact-card/index.tsx +++ b/packages/contact-card/index.tsx @@ -24,6 +24,12 @@ function ContactCard( ) { const { type, editable } = props; + function onClick(event: Event) { + if (editable) { + emit(ctx, 'click', event); + } + } + return ( { - if (editable) { - emit(ctx, 'click', event); - } - }} + onClick={onClick} {...inherit(ctx)} > {type === 'add' diff --git a/packages/goods-action-button/index.tsx b/packages/goods-action-button/index.tsx index 606f6154e..c09aadc77 100644 --- a/packages/goods-action-button/index.tsx +++ b/packages/goods-action-button/index.tsx @@ -23,10 +23,10 @@ function GoodsActionButton( slots: DefaultSlots, ctx: RenderContext ) { - const onClick = (event: Event) => { + function onClick(event: Event) { emit(ctx, 'click', event); functionalRoute(ctx); - }; + } return (