feat(CellGroup): add title slot (#4227)

This commit is contained in:
neverland
2019-08-25 10:55:01 +08:00
committed by GitHub
parent 689a579503
commit dc6a3c4243
5 changed files with 42 additions and 9 deletions
@@ -1,5 +1,12 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`CellGroup title slot 1`] = `
<div>
<div class="van-cell-group__title">CustomTitle</div>
<div class="van-cell-group van-hairline--top-bottom"></div>
</div>
`;
exports[`arrow direction 1`] = `
<div class="van-cell van-cell--clickable"><i class="van-icon van-icon-arrow-down van-cell__right-icon">
<!----></i></div>
+11
View File
@@ -1,4 +1,5 @@
import Cell from '..';
import CellGroup from '../../cell-group';
import { mount } from '../../../test/utils';
test('click event', () => {
@@ -56,3 +57,13 @@ test('title-style prop', () => {
expect(wrapper).toMatchSnapshot();
});
test('CellGroup title slot', () => {
const wrapper = mount(CellGroup, {
scopedSlots: {
title: () => 'CustomTitle'
}
});
expect(wrapper).toMatchSnapshot();
});