feat(Popup): add close-icon prop (#4366)

This commit is contained in:
neverland
2019-09-04 22:33:40 +08:00
committed by GitHub
parent f43be4dd86
commit 7b66aef056
8 changed files with 65 additions and 6 deletions
@@ -14,6 +14,7 @@ exports[`renders demo correctly 1`] = `
<!---->
</div>
<div><button class="van-button van-button--primary van-button--normal"><span class="van-button__text">关闭图标</span></button>
<!----> <button class="van-button van-button--primary van-button--normal"><span class="van-button__text">自定义图标</span></button>
<!---->
</div>
<div><button class="van-button van-button--primary van-button--normal"><span class="van-button__text">圆角弹窗</span></button>
@@ -1,5 +1,10 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`close-icon prop 1`] = `
<div class="van-popup van-popup--center" name="van-fade"><i class="van-icon van-icon-success van-popup__close-icon">
<!----></i></div>
`;
exports[`duration prop 1`] = `<div class="van-popup van-popup--center" style="transition-duration: 0.5s;" name="van-fade"></div>`;
exports[`reset z-index 1`] = `<div class="van-popup van-popup--center" name="van-fade"></div>`;
+12
View File
@@ -239,3 +239,15 @@ test('closeable prop', () => {
wrapper.find('.van-popup__close-icon').trigger('click');
expect(wrapper.emitted('input')[0][0]).toEqual(false);
});
test('close-icon prop', () => {
const wrapper = mount(Popup, {
propsData: {
value: true,
closeable: true,
closeIcon: 'success'
}
});
expect(wrapper).toMatchSnapshot();
});