chore: prettier source code
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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}`,
|
||||
},
|
||||
},
|
||||
|
||||
|
||||
@@ -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;
|
||||
});
|
||||
|
||||
|
||||
@@ -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 }));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user