diff --git a/packages/swipe-cell/index.js b/packages/swipe-cell/index.js
index 72f56bbe8..4ccb08fd9 100644
--- a/packages/swipe-cell/index.js
+++ b/packages/swipe-cell/index.js
@@ -146,17 +146,17 @@ export default sfc({
this.swipe = false;
}}
>
- {this.leftWidth && (
+ {this.leftWidth ? (
{this.slots('left')}
- )}
+ ) : null}
{this.slots()}
- {this.rightWidth && (
+ {this.rightWidth ? (
{this.slots('right')}
- )}
+ ) : null}
);
diff --git a/packages/swipe-cell/test/__snapshots__/index.spec.js.snap b/packages/swipe-cell/test/__snapshots__/index.spec.js.snap
index a48134c2e..d5ca12cbd 100644
--- a/packages/swipe-cell/test/__snapshots__/index.spec.js.snap
+++ b/packages/swipe-cell/test/__snapshots__/index.spec.js.snap
@@ -44,3 +44,9 @@ exports[`drag and show left part 5`] = `
`;
+
+exports[`width equals zero 1`] = `
+
+`;
diff --git a/packages/swipe-cell/test/index.spec.js b/packages/swipe-cell/test/index.spec.js
index 348a6f4c7..475f75293 100644
--- a/packages/swipe-cell/test/index.spec.js
+++ b/packages/swipe-cell/test/index.spec.js
@@ -64,3 +64,13 @@ test('on close prop', () => {
wrapper.trigger('click');
expect(wrapper.vm.offset).toEqual(0);
});
+
+it('width equals zero', () => {
+ const wrapper = mount(SwipeCell, {
+ propsData: {
+ leftWidth: 0,
+ rightWidth: 0
+ }
+ });
+ expect(wrapper).toMatchSnapshot();
+});