feat(TreeSelect): add className option (#4671)

This commit is contained in:
neverland
2019-10-10 09:48:11 +08:00
committed by GitHub
parent 514a27994a
commit cc03640576
4 changed files with 24 additions and 2 deletions
+18 -1
View File
@@ -262,7 +262,6 @@ test('max prop', () => {
data() {
return {
activeId: [],
mainActiveIndex: 0,
items: [
{
text: 'group1',
@@ -278,3 +277,21 @@ test('max prop', () => {
items.at(1).trigger('click');
expect(wrapper.vm.activeId).toEqual([mockItem.id]);
});
test('className of nav', () => {
const wrapper = mount(TreeSelect, {
propsData: {
mainActiveIndex: 0,
items: [
{
text: 'group1',
className: 'my-class',
children: []
}
]
}
});
const items = wrapper.findAll('.van-tree-select__nav-item');
expect(items.at(0).element.classList.contains('my-class')).toBeTruthy();
});