feat(Search): add action-text prop (#4501)

This commit is contained in:
neverland
2019-09-19 11:17:16 +08:00
committed by GitHub
parent a4b5f94232
commit 95c9fea1f7
6 changed files with 46 additions and 10 deletions
@@ -1,5 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`action-text prop 1`] = `
<div class="van-search van-search--show-action" 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>
</div>
</div>
</div>
<div class="van-search__action">
<div>Custom Text</div>
</div>
</div>
`;
exports[`label slot 1`] = `
<div class="van-search" style="background: rgb(255, 255, 255);">
<div class="van-search__content van-search__content--square">
+11
View File
@@ -104,3 +104,14 @@ test('right-icon slot', () => {
expect(wrapper).toMatchSnapshot();
});
test('action-text prop', () => {
const wrapper = mount(Search, {
propsData: {
actionText: 'Custom Text',
showAction: true
}
});
expect(wrapper).toMatchSnapshot();
});