[new feature] Cell: add label slot (#2956)

This commit is contained in:
neverland
2019-03-12 20:34:17 +08:00
committed by GitHub
parent d4a5644e88
commit a4eedac8b1
5 changed files with 55 additions and 4 deletions
@@ -0,0 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
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>
`;
exports[`render slot 1`] = `
<div class="van-cell">
<div class="van-cell__title">Custom Title<div class="van-cell__label">Custom Label</div>
</div>Custom Extra
</div>
`;
+28
View File
@@ -14,3 +14,31 @@ test('click event', () => {
wrapper.trigger('click');
expect(click.mock.calls.length).toBeTruthy();
});
test('arrow direction', () => {
const wrapper = mount(Cell, {
propsData: {
isLink: true,
arrowDirection: 'down'
}
});
expect(wrapper).toMatchSnapshot();
});
test('render slot', () => {
const wrapper = mount({
template: `
<cell>
<template v-slot:title>Custom Title</template>
<template v-slot:label>Custom Label</template>
<template v-slot:extra>Custom Extra</template>
</cell>
`,
components: {
Cell
}
});
expect(wrapper).toMatchSnapshot();
});