[new feature] Search: add clearable prop

This commit is contained in:
陈嘉涵
2019-05-28 09:24:26 +08:00
parent c0e2ce200e
commit 46a051cb05
4 changed files with 10 additions and 2 deletions

View File

@@ -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(
<div class={bem('content', props.shape)}>
{Label()}
<Field
clearable
type="search"
border={false}
value={props.value}
leftIcon={props.leftIcon}
rightIcon={props.rightIcon}
clearable={props.clearable}
scopedSlots={{
'left-icon': slots['left-icon'],
'right-icon': slots['right-icon']
@@ -119,6 +120,10 @@ Search.props = {
type: String,
default: 'square'
},
clearable: {
type: Boolean,
default: true
},
background: {
type: String,
default: '#fff'