diff --git a/packages/field/index.js b/packages/field/index.js index 7701f5fc5..74be91bd1 100644 --- a/packages/field/index.js +++ b/packages/field/index.js @@ -211,6 +211,14 @@ export default sfc({ render(h) { const { slots, labelAlign } = this; + + const scopedSlots = { + icon: this.renderLeftIcon + }; + if (slots('label')) { + scopedSlots.label = () => slots('title'); + } + return ( - {h('template', { slot: 'title' }, slots('label'))}
{this.renderInput()} {this.showClear && } diff --git a/packages/search/index.js b/packages/search/index.js index c190aeefe..1d15a8f32 100644 --- a/packages/search/index.js +++ b/packages/search/index.js @@ -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 (
- {h('template', { slot: 'left-icon' }, this.slots('left-icon'))} {showAction && (