perf(Tab): skip rendering empty pane (#7238)

This commit is contained in:
neverland
2020-09-23 18:00:26 +08:00
committed by GitHub
parent 17099d3ac1
commit 68d47fe16a
3 changed files with 37 additions and 2 deletions
+13
View File
@@ -410,3 +410,16 @@ test('before-change prop', async () => {
expect(onChange).toHaveBeenCalledTimes(2);
expect(onChange).toHaveBeenLastCalledWith(4, 'title5');
});
test('render empty tab', async () => {
const wrapper = mount({
template: `
<van-tabs>
<van-tab title="title1" />
<van-tab title="title2" />
</van-tabs>
`,
});
expect(wrapper).toMatchSnapshot();
});