mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
fix(Search): add update:modelValue emits (#7872)
This commit is contained in:
@@ -36,7 +36,7 @@ export default createComponent({
|
||||
},
|
||||
},
|
||||
|
||||
emits: ['search', 'cancel'],
|
||||
emits: ['update:modelValue', 'search', 'cancel'],
|
||||
|
||||
setup(props, { emit, slots, attrs }) {
|
||||
const filedRef = ref();
|
||||
@@ -110,6 +110,10 @@ export default createComponent({
|
||||
class: null,
|
||||
};
|
||||
|
||||
const onInput = (value) => {
|
||||
emit('update:modelValue', value);
|
||||
};
|
||||
|
||||
return (
|
||||
<Field
|
||||
v-slots={pick(slots, ['left-icon', 'right-icon'])}
|
||||
@@ -118,6 +122,7 @@ export default createComponent({
|
||||
border={false}
|
||||
onKeypress={onKeypress}
|
||||
{...fieldAttrs}
|
||||
{...{ 'onUpdate:modelValue': onInput }}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
Reference in New Issue
Block a user