[new feature] Tabs: add lazy-render props (#2800)

This commit is contained in:
neverland
2019-02-19 19:39:09 +08:00
committed by GitHub
parent 98e7d23eef
commit bff9c9d6d9
4 changed files with 68 additions and 2 deletions

View File

@@ -11,6 +11,7 @@ function createWrapper(options) {
:swipeable="swipeable"
:sticky="sticky"
:line-width="lineWidth"
:lazy-render="lazyRender"
>
<tab :title="title1">Text</tab>
<tab>
@@ -31,7 +32,8 @@ function createWrapper(options) {
type: 'line',
swipeable: true,
sticky: true,
lineWidth: 2
lineWidth: 2,
lazyRender: true
};
},
...options
@@ -97,3 +99,16 @@ test('change tabs data', async () => {
await later();
expect(wrapper).toMatchSnapshot();
});
test('lazy render', async () => {
const wrapper = createWrapper();
expect(wrapper).toMatchSnapshot();
wrapper.setData({
lazyRender: false
});
await later();
expect(wrapper).toMatchSnapshot();
});