feat(Picker): item-height support rem unit (#6462)

This commit is contained in:
neverland
2020-06-05 09:25:19 +08:00
committed by GitHub
parent 76c9e7ef1e
commit 2f2760aba6
12 changed files with 126 additions and 36 deletions
+18
View File
@@ -261,3 +261,21 @@ test('should not reset index when columns unchanged', () => {
wrapper.find('.van-picker__confirm').trigger('click');
expect(wrapper.emitted('confirm')[0]).toEqual(['2', 1]);
});
test('set rem item-height', async () => {
const originGetComputedStyle = window.getComputedStyle;
window.getComputedStyle = () => ({ fontSize: '16px' });
const wrapper = mount(Picker, {
propsData: {
columns: simpleColumn.slice(0, 2),
itemHeight: '10rem',
},
});
await later();
expect(wrapper).toMatchSnapshot();
window.getComputedStyle = originGetComputedStyle;
});