mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] Actionsheet: lazy-render not work (#2840)
This commit is contained in:
parent
6fff26caa1
commit
2b9c30f906
@ -91,6 +91,7 @@ function Actionsheet(
|
||||
value={props.value}
|
||||
position="bottom"
|
||||
overlay={props.overlay}
|
||||
lazyRender={props.lazyRender}
|
||||
closeOnClickOverlay={props.closeOnClickOverlay}
|
||||
onInput={(value: boolean) => {
|
||||
emit(ctx, 'input', value);
|
||||
|
@ -7,3 +7,11 @@ exports[`callback events 1`] = `
|
||||
<div class="van-actionsheet__cancel">Cancel</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`disable lazy-render 1`] = `
|
||||
<div class="van-popup van-popup--bottom van-actionsheet" style="display: none;" name="van-popup-slide-bottom">
|
||||
<div class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span></div>
|
||||
<div class="van-actionsheet__item van-hairline--top"><span class="van-actionsheet__name">Option</span></div>
|
||||
<div class="van-actionsheet__cancel">Cancel</div>
|
||||
</div>
|
||||
`;
|
||||
|
@ -37,3 +37,18 @@ test('callback events', () => {
|
||||
expect(onSelect.mock.calls[0][1]).toBeFalsy();
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
||||
test('disable lazy-render', () => {
|
||||
const wrapper = mount(Actionsheet, {
|
||||
propsData: {
|
||||
lazyRender: false,
|
||||
actions: [
|
||||
{ name: 'Option' },
|
||||
{ name: 'Option' }
|
||||
],
|
||||
cancelText: 'Cancel'
|
||||
}
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user