From 46a051cb05ce96e8019a5e051154e2134f133483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 28 May 2019 09:24:26 +0800 Subject: [PATCH] [new feature] Search: add clearable prop --- docs/markdown/changelog.zh-CN.md | 1 + packages/search/en-US.md | 1 + packages/search/index.tsx | 7 ++++++- packages/search/zh-CN.md | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/markdown/changelog.zh-CN.md b/docs/markdown/changelog.zh-CN.md index 93b011162..62ab668ce 100644 --- a/docs/markdown/changelog.zh-CN.md +++ b/docs/markdown/changelog.zh-CN.md @@ -30,6 +30,7 @@ ##### Search +- 新增`clearable`属性 - 新增`left-icon`属性 - 新增`right-icon`属性 - 新增`right-icon`插槽 diff --git a/packages/search/en-US.md b/packages/search/en-US.md index af1e5b14d..cabb49595 100644 --- a/packages/search/en-US.md +++ b/packages/search/en-US.md @@ -70,6 +70,7 @@ Search support all native properties of input tag,such as `maxlength`、`place | label | Search label | `String` | - | | shape | Can be set to `round` | `String` | `square` | | background | Background color | `String` | `#f2f2f2` | +| clearable | Whether to be clearable | `Boolean` | `true` | | show-action | Whether to show right button | `Boolean` | `false` | | disabled | Whether to disable field | `Boolean` | `false` | | readonly | Whether to be readonly | `Boolean` | `false` | diff --git a/packages/search/index.tsx b/packages/search/index.tsx index 76c8d8c1b..6b05a3d73 100644 --- a/packages/search/index.tsx +++ b/packages/search/index.tsx @@ -15,6 +15,7 @@ export type SearchProps = { label?: string; leftIcon: string; rightIcon?: string; + clearable: boolean; background: string; showAction?: boolean; }; @@ -92,12 +93,12 @@ function Search(
{Label()}