mirror of
https://github.com/youzan/vant.git
synced 2025-10-22 03:44:48 +00:00
[new feature] Tabs: add lazy-render props (#2800)
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
Reference in New Issue
Block a user