mirror of
https://github.com/youzan/vant.git
synced 2025-10-18 17:51:54 +00:00
[improvement] use scoped-slots (#2712)
This commit is contained in:
@@ -23,24 +23,28 @@ export default sfc({
|
||||
<Cell
|
||||
key={item.id}
|
||||
isLink
|
||||
scopedSlots={{
|
||||
default: () => (
|
||||
<Radio name={item.id}>
|
||||
<div class={bem('name')}>{`${item.name},${item.tel}`}</div>
|
||||
</Radio>
|
||||
),
|
||||
'right-icon': () => (
|
||||
<Icon
|
||||
name="edit"
|
||||
class={bem('edit')}
|
||||
onClick={event => {
|
||||
event.stopPropagation();
|
||||
listeners.edit && listeners.edit(item, index);
|
||||
}}
|
||||
/>
|
||||
)
|
||||
}}
|
||||
onClick={() => {
|
||||
listeners.input && listeners.input(item.id);
|
||||
listeners.select && listeners.select(item, index);
|
||||
}}
|
||||
>
|
||||
<Radio name={item.id}>
|
||||
<div class={bem('name')}>{`${item.name},${item.tel}`}</div>
|
||||
</Radio>
|
||||
<Icon
|
||||
slot="right-icon"
|
||||
name="edit"
|
||||
class={bem('edit')}
|
||||
onClick={event => {
|
||||
event.stopPropagation();
|
||||
listeners.edit && listeners.edit(item, index);
|
||||
}}
|
||||
/>
|
||||
</Cell>
|
||||
/>
|
||||
));
|
||||
|
||||
return (
|
||||
|
Reference in New Issue
Block a user