[new feature] Search: add right-icon slot
This commit is contained in:
@@ -45,3 +45,19 @@ exports[`right-icon prop 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`right-icon slot 1`] = `
|
||||
<div class="van-search" style="background: rgb(255, 255, 255);">
|
||||
<div class="van-search__content van-search__content--square">
|
||||
<div class="van-cell van-cell--borderless van-field">
|
||||
<div class="van-field__left-icon"><i class="van-icon van-icon-search">
|
||||
<!----></i></div>
|
||||
<div class="van-cell__value van-cell__value--alone">
|
||||
<div class="van-field__body"><input type="search" class="van-field__control">
|
||||
<div class="van-field__right-icon">Custom Right Icon</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable object-shorthand */
|
||||
import Search from '..';
|
||||
import { mount } from '../../../test/utils';
|
||||
|
||||
@@ -94,3 +95,15 @@ test('right-icon prop', () => {
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('right-icon slot', () => {
|
||||
const wrapper = mount(Search, {
|
||||
scopedSlots: {
|
||||
'right-icon'() {
|
||||
return 'Custom Right Icon';
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user