mirror of
https://github.com/youzan/vant.git
synced 2025-10-25 04:05:41 +00:00
[new feature] Search: add clearable prop
This commit is contained in:
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user