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:
iamkun
2019-07-31 12:03:12 +08:00
committed by Geass
parent c80e77f942
commit be71239990
12 changed files with 42 additions and 1 deletions

View File

@@ -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;
});
});
});