feat(Popover): add icon-prefix prop (#8703)

* fix: popover 增加 icon-prefix 属性

* fix: popover icon-prefix属性跑单测

Co-authored-by: 冷开俊 <lengkj@travelsky.com.cn>
This commit is contained in:
lengkaixin
2021-05-17 09:53:02 +08:00
committed by GitHub
co-authored by 冷开俊
parent bb7dccfeec
commit 908210a225
5 changed files with 27 additions and 1 deletions
@@ -10,6 +10,11 @@ exports[`should allow to custom the className of action 1`] = `
</div>
`;
exports[`should change icon class prefix when using icon-prefix prop 1`] = `
<span class="van-popover__wrapper">
</span>
`;
exports[`should locate to reference element when showed 1`] = `
<transition-stub>
</transition-stub>
+12
View File
@@ -187,3 +187,15 @@ test('should not close Popover when outside is clicked and close-on-click-outsid
trigger(document.body, 'touchstart');
expect(wrapper.emitted('update:show')).toBeFalsy();
});
test('should change icon class prefix when using icon-prefix prop', () => {
const wrapper = mount(Popover, {
props: {
show: true,
icon: 'success',
iconPrefix: 'my-icon',
},
});
expect(wrapper.html()).toMatchSnapshot();
});