diff --git a/packages/search/en-US.md b/packages/search/en-US.md index 89df08591..5b344083a 100644 --- a/packages/search/en-US.md +++ b/packages/search/en-US.md @@ -68,7 +68,6 @@ 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` | @@ -76,6 +75,8 @@ Search support all native properties of input tag,such as `maxlength`、`place | readonly | Whether to be readonly | `Boolean` | `false` | | error | Whether to show error info | `Boolean` | `false` | | input-align | Input text align, can be set to `center` `right` | `String` | `left` | +| left-icon | Left icon name | `String` | `search` | +| right-icon | Right icon name | `String` | - | ### Events diff --git a/packages/search/index.tsx b/packages/search/index.tsx index efcdc9027..c3e5ecade 100644 --- a/packages/search/index.tsx +++ b/packages/search/index.tsx @@ -14,6 +14,7 @@ export type SearchProps = { value?: string; label?: string; leftIcon: string; + rightIcon?: string; background: string; showAction?: boolean; }; @@ -95,6 +96,7 @@ function Search( border={false} value={props.value} leftIcon={props.leftIcon} + rightIcon={props.rightIcon} scopedSlots={{ 'left-icon': slots['left-icon'] }} {...fieldData} /> @@ -107,6 +109,7 @@ function Search( Search.props = { value: String, label: String, + rightIcon: String, showAction: Boolean, shape: { type: String, diff --git a/packages/search/test/__snapshots__/index.spec.js.snap b/packages/search/test/__snapshots__/index.spec.js.snap index 206fa72e8..b16bd0585 100644 --- a/packages/search/test/__snapshots__/index.spec.js.snap +++ b/packages/search/test/__snapshots__/index.spec.js.snap @@ -28,3 +28,20 @@ exports[`render label slot 1`] = ` `; + +exports[`right-icon prop 1`] = ` +