mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[bugfix] SwipeCell: incorrect render when left-width equals zero (#2737)
This commit is contained in:
parent
a152309cfc
commit
7e774bcff2
@ -146,17 +146,17 @@ export default sfc({
|
|||||||
this.swipe = false;
|
this.swipe = false;
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{this.leftWidth && (
|
{this.leftWidth ? (
|
||||||
<div class={bem('left')} onClick={onClick('left', true)}>
|
<div class={bem('left')} onClick={onClick('left', true)}>
|
||||||
{this.slots('left')}
|
{this.slots('left')}
|
||||||
</div>
|
</div>
|
||||||
)}
|
) : null}
|
||||||
{this.slots()}
|
{this.slots()}
|
||||||
{this.rightWidth && (
|
{this.rightWidth ? (
|
||||||
<div class={bem('right')} onClick={onClick('right', true)}>
|
<div class={bem('right')} onClick={onClick('right', true)}>
|
||||||
{this.slots('right')}
|
{this.slots('right')}
|
||||||
</div>
|
</div>
|
||||||
)}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -44,3 +44,9 @@ exports[`drag and show left part 5`] = `
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`width equals zero 1`] = `
|
||||||
|
<div class="van-swipe-cell">
|
||||||
|
<div class="van-swipe-cell__wrapper" style="transform: translate3d(0px, 0, 0);"></div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
@ -64,3 +64,13 @@ test('on close prop', () => {
|
|||||||
wrapper.trigger('click');
|
wrapper.trigger('click');
|
||||||
expect(wrapper.vm.offset).toEqual(0);
|
expect(wrapper.vm.offset).toEqual(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('width equals zero', () => {
|
||||||
|
const wrapper = mount(SwipeCell, {
|
||||||
|
propsData: {
|
||||||
|
leftWidth: 0,
|
||||||
|
rightWidth: 0
|
||||||
|
}
|
||||||
|
});
|
||||||
|
expect(wrapper).toMatchSnapshot();
|
||||||
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user