diff --git a/src/search/README.md b/src/search/README.md index 02b4d7029..55669ebad 100644 --- a/src/search/README.md +++ b/src/search/README.md @@ -146,7 +146,8 @@ Use `action` slot to custom right button, `cancel` event will no longer be trigg | Name | Description | |------|------| -| label | Custom Search label | +| left | Custom left side content | | action | Custom right button, displayed when `show-action` is `true` | +| label | Custom Search label | | left-icon | Custom left icon | | right-icon | Custom right icon | diff --git a/src/search/README.zh-CN.md b/src/search/README.zh-CN.md index a8d02390f..b33498bc5 100644 --- a/src/search/README.zh-CN.md +++ b/src/search/README.zh-CN.md @@ -146,7 +146,8 @@ export default { | 名称 | 说明 | |------|------| -| label | 自定义搜索框左侧文本 | -| action | 自定义搜索框右侧按钮,设置`show-action`属性后展示 | -| left-icon | 自定义输入框左侧图标 | -| right-icon | 自定义输入框右侧图标 | +| left | 自定义左侧内容(搜索框外) | +| action | 自定义右侧内容(搜索框外),设置`show-action`属性后展示 | +| label | 自定义左侧文本(搜索框内) | +| left-icon | 自定义左侧图标(搜索框内) | +| right-icon | 自定义右侧图标(搜索框内) | diff --git a/src/search/index.tsx b/src/search/index.tsx index 06e93c866..a2325d457 100644 --- a/src/search/index.tsx +++ b/src/search/index.tsx @@ -25,6 +25,7 @@ export type SearchProps = { }; export type SearchSlots = DefaultSlots & { + left?: ScopedSlot; label?: ScopedSlot; action?: ScopedSlot; 'left-icon'?: ScopedSlot; @@ -99,6 +100,7 @@ function Search( style={{ background: props.background }} {...inheritData} > + {slots.left?.()}
{Label()} `; +exports[`left slot 1`] = ` + +`; + exports[`left-icon prop 1`] = `