mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-16 11:44:01 +08:00
Date-Picker: add className picker option (#16632)
* add classname * add docs * add test * add range picker * update api name * update api name * update test
This commit is contained in:
@@ -2831,4 +2831,25 @@ describe('DatePicker', () => {
|
||||
}, DELAY);
|
||||
});
|
||||
});
|
||||
describe('picker-options:className', () => {
|
||||
it('set custom class name', async() => {
|
||||
vm = createVue({
|
||||
template: '<el-date-picker type="datetime" v-model="value" ref="compo" :pickerOptions="pickerOptions" />',
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
pickerOptions: {
|
||||
cellClassName() { return 'test-class'; }
|
||||
}
|
||||
};
|
||||
}
|
||||
}, true);
|
||||
vm.$refs.compo.$el.querySelector('input').focus();
|
||||
await wait();
|
||||
expect(
|
||||
(vm.$refs.compo.picker.$el.querySelector('.el-date-table__row td').className)
|
||||
.indexOf('test-class') > -1
|
||||
).to.be.true;
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user