feat(Calendar): add top-info、bottom-info slot (#8716)
This commit is contained in:
@@ -924,6 +924,21 @@ exports[`row-height prop 1`] = `
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`should render top-info and bottom-info slot correctly 1`] = `
|
||||
<div role="gridcell"
|
||||
style="margin-left: 71.42857142857143%;"
|
||||
class="van-calendar__day van-calendar__day--disabled"
|
||||
>
|
||||
<div class="van-calendar__top-info">
|
||||
top: 1
|
||||
</div>
|
||||
1
|
||||
<div class="van-calendar__bottom-info">
|
||||
bottom: 1
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`title & footer slot 1`] = `
|
||||
<div class="van-calendar">
|
||||
<div class="van-calendar__header">
|
||||
|
||||
@@ -533,3 +533,23 @@ test('close event', async () => {
|
||||
|
||||
expect(onClose).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
test('should render top-info and bottom-info slot correctly', async () => {
|
||||
const wrapper = mount(Calendar, {
|
||||
props: {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false,
|
||||
defaultDate: minDate,
|
||||
lazyRender: false,
|
||||
},
|
||||
slots: {
|
||||
'top-info': (item) => 'top: ' + item.text,
|
||||
'bottom-info': (item) => 'bottom: ' + item.text,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
|
||||
expect(wrapper.find('.van-calendar__day').html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user