feat(Calendar): add subtitle slot (#8980)
This commit is contained in:
@@ -900,28 +900,14 @@ 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`] = `
|
||||
exports[`should render title、footer、subtitle slot correctly 1`] = `
|
||||
<div class="van-calendar">
|
||||
<div class="van-calendar__header">
|
||||
<div class="van-calendar__header-title">
|
||||
Custom Title
|
||||
</div>
|
||||
<div class="van-calendar__header-subtitle">
|
||||
Custom Subtitle
|
||||
</div>
|
||||
<div class="van-calendar__weekdays">
|
||||
<span class="van-calendar__weekday">
|
||||
@@ -1132,3 +1118,18 @@ exports[`title & footer slot 1`] = `
|
||||
</div>
|
||||
</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>
|
||||
`;
|
||||
|
||||
@@ -344,7 +344,7 @@ test('formatter prop', async () => {
|
||||
expect(wrapper.html()).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('title & footer slot', async () => {
|
||||
test('should render title、footer、subtitle slot correctly', async () => {
|
||||
const wrapper = mount(Calendar, {
|
||||
props: {
|
||||
minDate,
|
||||
@@ -356,6 +356,7 @@ test('title & footer slot', async () => {
|
||||
slots: {
|
||||
title: () => 'Custom Title',
|
||||
footer: () => 'Custom Footer',
|
||||
subtitle: () => 'Custom Subtitle',
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user