feat(Calendar): add subtitle slot (#8980)

This commit is contained in:
neverland
2021-07-05 13:06:04 +08:00
committed by GitHub
parent 8bc924ea62
commit 779f3363c2
6 changed files with 25 additions and 20 deletions
@@ -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>
`;
+2 -1
View File
@@ -344,7 +344,7 @@ test('formatter prop', async () => {
expect(wrapper.html()).toMatchSnapshot();
});
test('title & footer slot', async () => {
test('should render titlefooter、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',
},
});