[new feature] Field: add input slot

This commit is contained in:
陈嘉涵
2019-06-06 10:47:32 +08:00
parent 384b2f4001
commit f898b61e44
7 changed files with 55 additions and 2 deletions
@@ -44,6 +44,16 @@ exports[`label-width prop without unit 1`] = `
</div>
`;
exports[`render input slot 1`] = `
<div class="van-cell van-field">
<div class="van-cell__value van-cell__value--alone">
<div class="van-field__body">
<div class="van-field__control">Custom Input</div>
</div>
</div>
</div>
`;
exports[`render label slot 1`] = `
<div class="van-cell van-field">
<div class="van-cell__title van-field__label">Custom Label</div>
+15
View File
@@ -167,6 +167,21 @@ test('clearable', () => {
expect(wrapper.emitted('clear')).toBeTruthy();
});
test('render input slot', () => {
const wrapper = mount({
template: `
<field>
<template v-slot:input>Custom Input</template>
</field>
`,
components: {
Field
}
});
expect(wrapper).toMatchSnapshot();
});
test('render label slot', () => {
const wrapper = mount({
template: `