feat(SidebarItem): add title slot (#7220)

This commit is contained in:
JSparow
2020-09-21 21:29:09 +08:00
committed by GitHub
parent f609c224b1
commit e201bc55ee
5 changed files with 41 additions and 1 deletions
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`title slot 1`] = `
<div class="van-sidebar"><a class="van-sidebar-item van-sidebar-item--select">
<div class="van-sidebar-item__text">Title Slot
<!---->
</div>
</a></div>
`;
+19
View File
@@ -76,3 +76,22 @@ test('without parent', () => {
expect(err).toBeTruthy();
}
});
test('title slot', () => {
const wrapper = mount({
template: `
<van-sidebar v-model="active">
<van-sidebar-item>
<template #title>Title Slot</template>
</van-sidebar-item>
</van-sidebar>
`,
data() {
return {
active: 0,
};
},
});
expect(wrapper).toMatchSnapshot();
});