feat(Tabbar): add placeholder prop (#5979)

This commit is contained in:
neverland
2020-04-01 20:41:04 +08:00
committed by GitHub
parent 0698872285
commit 02e67fdd47
7 changed files with 70 additions and 17 deletions
@@ -2,6 +2,12 @@
exports[`disable border 1`] = `<div class="van-tabbar van-tabbar--fixed"></div>`;
exports[`placeholder prop 1`] = `
<div class="van-tabbar__placeholder" style="height: 50px;">
<div class="van-hairline--top-bottom van-tabbar van-tabbar--fixed"></div>
</div>
`;
exports[`route mode 1`] = `
<div class="van-hairline--top-bottom van-tabbar van-tabbar--fixed">
<div class="van-tabbar-item van-tabbar-item--active">
+16 -1
View File
@@ -1,5 +1,5 @@
import VueRouter from 'vue-router';
import { mount, later } from '../../../test';
import { mount, later, mockGetBoundingClientRect } from '../../../test';
import Vue from 'vue';
import Tabbar from '..';
@@ -174,3 +174,18 @@ test('disable border', () => {
expect(wrapper).toMatchSnapshot();
});
test('placeholder prop', () => {
const restore = mockGetBoundingClientRect({ height: 50 });
const wrapper = mount(Tabbar, {
propsData: {
fixed: true,
placeholder: true,
},
});
expect(wrapper).toMatchSnapshot();
restore();
});