feat(Field): add extra slot (#6290)

* feat(Field): add extra slot

* docs: remove form demo style
This commit is contained in:
neverland
2020-05-16 11:18:08 +08:00
committed by GitHub
parent 5c8d1d2420
commit 6870bdcbc2
11 changed files with 124 additions and 119 deletions
+16 -16
View File
@@ -203,14 +203,9 @@ test('clearable', () => {
});
test('render input slot', () => {
const wrapper = mount({
template: `
<field>
<template v-slot:input>Custom Input</template>
</field>
`,
components: {
Field,
const wrapper = mount(Field, {
scopedSlots: {
input: () => 'Custom Input',
},
});
@@ -218,14 +213,19 @@ test('render input slot', () => {
});
test('render label slot', () => {
const wrapper = mount({
template: `
<field label="Default Label">
<template v-slot:label>Custom Label</template>
</field>
`,
components: {
Field,
const wrapper = mount(Field, {
scopedSlots: {
label: () => 'Custom Label',
},
});
expect(wrapper).toMatchSnapshot();
});
test('render extra slot', () => {
const wrapper = mount(Field, {
scopedSlots: {
extra: () => 'Extra',
},
});