feat(Field): add extra slot (#6290)
* feat(Field): add extra slot * docs: remove form demo style
This commit is contained in:
@@ -79,6 +79,14 @@ exports[`reach max word-limit 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`render extra slot 1`] = `
|
||||
<div class="van-cell van-field">
|
||||
<div class="van-cell__value van-cell__value--alone van-field__value">
|
||||
<div class="van-field__body"><input type="text" class="van-field__control"></div>
|
||||
</div>Extra
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`render input slot 1`] = `
|
||||
<div class="van-cell van-field">
|
||||
<div class="van-cell__value van-cell__value--alone van-field__value">
|
||||
|
||||
@@ -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',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user