feat(Field): add colon prop (#6195)

This commit is contained in:
neverland
2020-05-01 19:31:23 +08:00
committed by GitHub
parent a7294ea980
commit 4adefe5605
6 changed files with 26 additions and 1 deletions
@@ -26,6 +26,15 @@ exports[`clearable 2`] = `
</div>
`;
exports[`colon prop 1`] = `
<div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>foo:</span></div>
<div class="van-cell__value van-field__value">
<div class="van-field__body"><input type="text" class="van-field__control"></div>
</div>
</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>
+10
View File
@@ -314,3 +314,13 @@ test('call focus method before mounted', (done) => {
test('destroy field', () => {
mount(Field).destroy();
});
test('colon prop', () => {
const wrapper = mount(Field, {
propsData: {
label: 'foo',
colon: true,
},
});
expect(wrapper).toMatchSnapshot();
});