feat(Calendar): add top-info、bottom-info slot (#8716)

This commit is contained in:
neverland
2021-05-18 10:09:02 +08:00
committed by GitHub
parent c0fa715cf4
commit db41f5ad44
7 changed files with 82 additions and 21 deletions
+20
View File
@@ -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();
});