[new feature] Field: add label-class prop

This commit is contained in:
陈嘉涵
2019-05-02 17:48:51 +08:00
parent e9e6e238db
commit 7f0615a503
6 changed files with 28 additions and 2 deletions
@@ -17,6 +17,15 @@ exports[`clearable 2`] = `
</div>
`;
exports[`label-class prop 1`] = `
<div class="van-cell van-field">
<div class="van-cell__title van-field__label custom-label-class"><span>Label</span></div>
<div class="van-cell__value">
<div class="van-field__body"><input type="text" class="van-field__control"></div>
</div>
</div>
`;
exports[`label-width prop with unit 1`] = `
<div class="van-cell van-field">
<div class="van-cell__title van-field__label" style="width: 10rem;"><span>Label</span></div>
+10
View File
@@ -203,3 +203,13 @@ test('label-width prop without unit', () => {
});
expect(wrapper).toMatchSnapshot();
});
test('label-class prop', () => {
const wrapper = mount(Field, {
propsData: {
label: 'Label',
labelClass: 'custom-label-class'
}
});
expect(wrapper).toMatchSnapshot();
});