mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
This commit is contained in:
parent
be96fa2233
commit
968ec97256
@ -148,12 +148,10 @@ export default createComponent({
|
||||
},
|
||||
|
||||
onClickLeftIcon(event) {
|
||||
event.stopPropagation();
|
||||
this.$emit('click-left-icon', event);
|
||||
},
|
||||
|
||||
onClickRightIcon(event) {
|
||||
event.stopPropagation();
|
||||
this.$emit('click-right-icon', event);
|
||||
},
|
||||
|
||||
|
@ -28,7 +28,7 @@ test('click icon event', () => {
|
||||
|
||||
wrapper.find('.van-field__left-icon').trigger('click');
|
||||
wrapper.find('.van-field__right-icon').trigger('click');
|
||||
expect(wrapper.emitted('click')).toBeFalsy();
|
||||
expect(wrapper.emitted('click').length).toEqual(2);
|
||||
expect(wrapper.emitted('click-left-icon')[0][0]).toBeTruthy();
|
||||
expect(wrapper.emitted('click-right-icon')[0][0]).toBeTruthy();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user