chore: prettier source code

This commit is contained in:
chenjiahan
2020-04-02 15:36:02 +08:00
parent 340c56b3b5
commit 2fb5cca49a
93 changed files with 272 additions and 283 deletions
+3 -2
View File
@@ -102,8 +102,9 @@ export default createComponent({
};
if (scale !== 1) {
style.transform = `scale3d(${scale}, ${scale}, 1) translate(${this
.moveX / scale}px, ${this.moveY / scale}px)`;
style.transform = `scale3d(${scale}, ${scale}, 1) translate(${
this.moveX / scale
}px, ${this.moveY / scale}px)`;
}
return style;
+2 -2
View File
@@ -53,7 +53,7 @@ export default {
button3: '异步关闭',
button4: '展示关闭按钮',
componentCall: '组件调用',
index: index => `${index + 1}`,
index: (index) => `${index + 1}`,
},
'en-US': {
button1: 'Show Images',
@@ -61,7 +61,7 @@ export default {
button3: 'Async Close',
button4: 'Show Close Icon',
componentCall: 'Component Call',
index: index => `Page: ${index}`,
index: (index) => `Page: ${index}`,
},
},
+3 -3
View File
@@ -30,13 +30,13 @@ const initInstance = () => {
});
document.body.appendChild(instance.$el);
instance.$on('change', index => {
instance.$on('change', (index) => {
if (instance.onChange) {
instance.onChange(index);
}
});
instance.$on('scale', data => {
instance.$on('scale', (data) => {
if (instance.onScale) {
instance.onScale(data);
}
@@ -57,7 +57,7 @@ const ImagePreview = (images, startPosition = 0) => {
Object.assign(instance, defaultConfig, options);
instance.$once('input', show => {
instance.$once('input', (show) => {
instance.value = show;
});
+4 -4
View File
@@ -103,7 +103,7 @@ test('async close prop', async () => {
expect(wrapper.emitted('close')[0]).toBeTruthy();
});
test('function call', done => {
test('function call', (done) => {
ImagePreview(images);
ImagePreview(images.slice(0, 1));
Vue.nextTick(() => {
@@ -116,7 +116,7 @@ test('function call', done => {
});
});
test('double click', async done => {
test('double click', async (done) => {
const instance = ImagePreview(images);
await later();
@@ -150,7 +150,7 @@ test('onClose option', () => {
});
});
test('onChange option', async done => {
test('onChange option', async (done) => {
const instance = ImagePreview({
images,
startPostion: 0,
@@ -164,7 +164,7 @@ test('onChange option', async done => {
triggerDrag(swipe, 1000, 0);
});
test('onScale option', async done => {
test('onScale option', async (done) => {
const { getBoundingClientRect } = Element.prototype;
Element.prototype.getBoundingClientRect = jest.fn(() => ({ width: 100 }));