feat(Field): add clear-icon prop (#8438)

This commit is contained in:
neverland
2021-04-01 09:51:00 +08:00
committed by GitHub
parent d51db70789
commit 2a065f85ef
5 changed files with 30 additions and 1 deletions
+14
View File
@@ -430,3 +430,17 @@ test('should allow to set autocomplete attribute', () => {
'on'
);
});
test('should change clear icon when using clear-icon prop', async () => {
const wrapper = mount(Field, {
props: {
clearable: true,
clearIcon: 'cross',
modelValue: 'test',
},
});
const input = wrapper.find('input');
await input.trigger('focus');
expect(wrapper.find('.van-field__clear').html()).toMatchSnapshot();
});