fix(Picker): disabled not work in cascade mode (#6580)

This commit is contained in:
neverland
2020-06-20 16:03:30 +08:00
committed by GitHub
parent 8844679a24
commit 76cf64a2bf
3 changed files with 47 additions and 12 deletions
@@ -0,0 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`disabled in cascade 1`] = `
<li role="button" tabindex="-1" class="van-picker-column__item van-picker-column__item--disabled">
<div class="van-ellipsis">A2</div>
</li>
`;
+17
View File
@@ -108,3 +108,20 @@ test('setIndexes of cascade columns', () => {
wrapper.find('.van-picker__confirm').trigger('click');
expect(wrapper.emitted('confirm')[0][0]).toEqual(['A2', 'B3', 'C6']);
});
test('disabled in cascade', () => {
const wrapper = mount(Picker, {
propsData: {
showToolbar: true,
columns: [
COLUMNS[0],
{
...COLUMNS[1],
disabled: true,
},
],
},
});
expect(wrapper.find('.van-picker-column__item--disabled')).toMatchSnapshot();
});