mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 11:54:02 +00:00
fix template slot
This commit is contained in:
@@ -53,6 +53,11 @@ export default sfc({
|
||||
on: this.listeners
|
||||
};
|
||||
|
||||
const scopedSlots = {};
|
||||
if (this.slots('left-icon')) {
|
||||
scopedSlots['left-icon'] = () => this.slots('left-icon');
|
||||
}
|
||||
|
||||
return (
|
||||
<div class={bem({ 'show-action': showAction })} style={{ background: this.background }}>
|
||||
<Field
|
||||
@@ -61,9 +66,9 @@ export default sfc({
|
||||
value={this.value}
|
||||
border={false}
|
||||
leftIcon="search"
|
||||
scopedSlots={scopedSlots}
|
||||
{...props}
|
||||
>
|
||||
{h('template', { slot: 'left-icon' }, this.slots('left-icon'))}
|
||||
</Field>
|
||||
{showAction && (
|
||||
<div class={bem('action')}>
|
||||
|
Reference in New Issue
Block a user