diff --git a/packages/search/en-US.md b/packages/search/en-US.md index b71d8459e..89df08591 100644 --- a/packages/search/en-US.md +++ b/packages/search/en-US.md @@ -68,6 +68,7 @@ Search support all native properties of input tag,such as `maxlength`、`place | Attribute | Description | Type | Default | |------|------|------|------| | label | Search label | `String` | - | +| left-icon | Left icon name | `String` | `search` | | shape | Can be set to `round` | `String` | `square` | | background | Background color | `String` | `#f2f2f2` | | show-action | Whether to show right button | `Boolean` | `false` | diff --git a/packages/search/index.tsx b/packages/search/index.tsx index 57727f4d8..efcdc9027 100644 --- a/packages/search/index.tsx +++ b/packages/search/index.tsx @@ -13,6 +13,7 @@ export type SearchProps = { shape: string; value?: string; label?: string; + leftIcon: string; background: string; showAction?: boolean; }; @@ -91,9 +92,9 @@ function Search( @@ -114,6 +115,10 @@ Search.props = { background: { type: String, default: '#fff' + }, + leftIcon: { + type: String, + default: 'search' } }; diff --git a/packages/search/test/__snapshots__/index.spec.js.snap b/packages/search/test/__snapshots__/index.spec.js.snap index c0e18f310..206fa72e8 100644 --- a/packages/search/test/__snapshots__/index.spec.js.snap +++ b/packages/search/test/__snapshots__/index.spec.js.snap @@ -1,5 +1,19 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP +exports[`left-icon prop 1`] = ` + +`; + exports[`render label slot 1`] = `