feat(Picker): add readonly prop (#7105)

This commit is contained in:
neverland
2020-09-05 06:50:59 +08:00
committed by GitHub
parent f6e3aaebec
commit 3cd200f7c2
6 changed files with 33 additions and 1 deletions
+15
View File
@@ -279,3 +279,18 @@ test('set rem item-height', async () => {
window.getComputedStyle = originGetComputedStyle;
});
test('readonly prop', () => {
const wrapper = mount(Picker, {
propsData: {
columns,
readonly: true,
},
});
triggerDrag(wrapper.find('.van-picker-column'), 0, -100);
wrapper.find('.van-picker-column ul').trigger('transitionend');
wrapper.findAll('.van-picker-column__item').at(3).trigger('click');
expect(wrapper.emitted('change')).toBeFalsy();
});