chore: add trailingComma
This commit is contained in:
@@ -66,7 +66,7 @@ export default {
|
||||
collect: '收藏',
|
||||
title: '单元格',
|
||||
title2: '异步关闭',
|
||||
confirm: '确定删除吗?'
|
||||
confirm: '确定删除吗?',
|
||||
},
|
||||
'en-US': {
|
||||
select: 'Select',
|
||||
@@ -74,8 +74,8 @@ export default {
|
||||
collect: 'Collect',
|
||||
title: 'Cell',
|
||||
title2: 'Async close',
|
||||
confirm: 'Are you sure to delete?'
|
||||
}
|
||||
confirm: 'Are you sure to delete?',
|
||||
},
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -88,14 +88,14 @@ export default {
|
||||
break;
|
||||
case 'right':
|
||||
this.$dialog.confirm({
|
||||
message: this.$t('confirm')
|
||||
message: this.$t('confirm'),
|
||||
}).then(() => {
|
||||
instance.close();
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+12
-12
@@ -12,8 +12,8 @@ export default createComponent({
|
||||
TouchMixin,
|
||||
ClickOutsideMixin({
|
||||
event: 'touchstart',
|
||||
method: 'onClick'
|
||||
})
|
||||
method: 'onClick',
|
||||
}),
|
||||
],
|
||||
|
||||
props: {
|
||||
@@ -27,14 +27,14 @@ export default createComponent({
|
||||
stopPropagation: Boolean,
|
||||
name: {
|
||||
type: [Number, String],
|
||||
default: ''
|
||||
}
|
||||
default: '',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
offset: 0,
|
||||
dragging: false
|
||||
dragging: false,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -45,7 +45,7 @@ export default createComponent({
|
||||
|
||||
computedRightWidth() {
|
||||
return this.rightWidth || this.getWidthByRef('right');
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -75,7 +75,7 @@ export default createComponent({
|
||||
name: this.name,
|
||||
// @deprecated
|
||||
// should be removed in next major version
|
||||
detail: this.name
|
||||
detail: this.name,
|
||||
});
|
||||
},
|
||||
|
||||
@@ -87,7 +87,7 @@ export default createComponent({
|
||||
this.opened = false;
|
||||
this.$emit('close', {
|
||||
position,
|
||||
name: this.name
|
||||
name: this.name,
|
||||
});
|
||||
}
|
||||
},
|
||||
@@ -172,7 +172,7 @@ export default createComponent({
|
||||
this.beforeClose({
|
||||
position,
|
||||
name: this.name,
|
||||
instance: this
|
||||
instance: this,
|
||||
});
|
||||
} else if (this.onClose) {
|
||||
this.onClose(position, this, { name: this.name });
|
||||
@@ -221,13 +221,13 @@ export default createComponent({
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
const wrapperStyle = {
|
||||
transform: `translate3d(${this.offset}px, 0, 0)`,
|
||||
transitionDuration: this.dragging ? '0s' : '.6s'
|
||||
transitionDuration: this.dragging ? '0s' : '.6s',
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -239,5 +239,5 @@ export default createComponent({
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -3,19 +3,19 @@ import {
|
||||
mount,
|
||||
triggerDrag,
|
||||
later,
|
||||
mockGetBoundingClientRect
|
||||
mockGetBoundingClientRect,
|
||||
} from '../../../test';
|
||||
|
||||
const THRESHOLD = 0.15;
|
||||
const defaultProps = {
|
||||
propsData: {
|
||||
leftWidth: 100,
|
||||
rightWidth: 100
|
||||
rightWidth: 100,
|
||||
},
|
||||
scopedSlots: {
|
||||
left: () => 'Left',
|
||||
right: () => 'Right'
|
||||
}
|
||||
right: () => 'Right',
|
||||
},
|
||||
};
|
||||
|
||||
test('drag and show left part', () => {
|
||||
@@ -52,8 +52,8 @@ test('on-close prop', () => {
|
||||
onClose(pos, ins) {
|
||||
position = pos;
|
||||
instance = ins;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -89,8 +89,8 @@ test('before-close prop', () => {
|
||||
beforeClose(params) {
|
||||
({ position } = params);
|
||||
({ instance } = params);
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -124,8 +124,8 @@ test('name prop', done => {
|
||||
onClose(position, instance, detail) {
|
||||
expect(detail.name).toEqual('test');
|
||||
done();
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.vm.open('left');
|
||||
@@ -143,8 +143,8 @@ test('disabled prop', () => {
|
||||
const wrapper = mount(SwipeCell, {
|
||||
propsData: {
|
||||
...defaultProps.propsData,
|
||||
disabled: true
|
||||
}
|
||||
disabled: true,
|
||||
},
|
||||
});
|
||||
|
||||
triggerDrag(wrapper, 50, 0);
|
||||
@@ -153,11 +153,11 @@ test('disabled prop', () => {
|
||||
|
||||
test('auto calc width', async () => {
|
||||
const restoreMock = mockGetBoundingClientRect({
|
||||
width: 50
|
||||
width: 50,
|
||||
});
|
||||
|
||||
const wrapper = mount(SwipeCell, {
|
||||
scopedSlots: defaultProps.scopedSlots
|
||||
scopedSlots: defaultProps.scopedSlots,
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -169,13 +169,13 @@ test('auto calc width', async () => {
|
||||
|
||||
test('render one side', async () => {
|
||||
const restoreMock = mockGetBoundingClientRect({
|
||||
width: 50
|
||||
width: 50,
|
||||
});
|
||||
|
||||
const wrapper = mount(SwipeCell, {
|
||||
scopedSlots: {
|
||||
left: defaultProps.scopedSlots.left
|
||||
}
|
||||
left: defaultProps.scopedSlots.left,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -192,7 +192,7 @@ test('trigger open event when open left side', () => {
|
||||
expect(wrapper.emitted('open')[0][0]).toEqual({
|
||||
name: '',
|
||||
detail: '',
|
||||
position: 'left'
|
||||
position: 'left',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -203,7 +203,7 @@ test('trigger open event when open right side', () => {
|
||||
expect(wrapper.emitted('open')[0][0]).toEqual({
|
||||
name: '',
|
||||
detail: '',
|
||||
position: 'right'
|
||||
position: 'right',
|
||||
});
|
||||
});
|
||||
|
||||
@@ -215,7 +215,7 @@ test('trigger close event when closed', () => {
|
||||
|
||||
expect(wrapper.emitted('close')[0][0]).toEqual({
|
||||
name: '',
|
||||
position: undefined
|
||||
position: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user