feat(Form): add colon prop

This commit is contained in:
陈嘉涵
2020-02-14 12:12:44 +08:00
parent 911b6769e4
commit 9371bc06c8
6 changed files with 52 additions and 6 deletions
@@ -1,5 +1,22 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`colon prop 1`] = `
<form class="van-form">
<div class="van-cell van-field">
<div class="van-cell__title van-field__label"><span>Label:</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>
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">Custom Label:</div>
<div class="van-cell__value van-field__value">
<div class="van-field__body"><input type="text" class="van-field__control"></div>
</div>
</div>
</form>
`;
exports[`error-message-align prop 1`] = `
<form class="van-form">
<div class="van-cell van-field">
+14
View File
@@ -105,6 +105,20 @@ test('validate-first prop', async () => {
expect(onSubmit).toHaveBeenCalledWith({ A: 'foo', B: 'foo' });
});
test('colon prop', () => {
const wrapper = mountForm({
template: `
<van-form colon>
<van-field label="Label" />
<van-field>
<template #label>Custom Label</template>
</van-field>
</van-form>
`,
});
expect(wrapper).toMatchSnapshot();
});
test('label-align prop', () => {
const wrapper = mountForm({
template: `