chore: add trailingComma
This commit is contained in:
@@ -65,7 +65,7 @@ export default {
|
||||
roundCorner: '圆角弹窗',
|
||||
closeIcon: '关闭图标',
|
||||
customCloseIcon: '自定义图标',
|
||||
customIconPosition: '图标位置'
|
||||
customIconPosition: '图标位置',
|
||||
},
|
||||
'en-US': {
|
||||
position: 'Position',
|
||||
@@ -78,8 +78,8 @@ export default {
|
||||
roundCorner: 'Round Corner',
|
||||
closeIcon: 'Close Icon',
|
||||
customCloseIcon: 'Custom Icon',
|
||||
customIconPosition: 'Icon Position'
|
||||
}
|
||||
customIconPosition: 'Icon Position',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -93,9 +93,9 @@ export default {
|
||||
showRoundCorner: false,
|
||||
showGetContainer: false,
|
||||
showCustomCloseIcon: false,
|
||||
showCustomIconPosition: false
|
||||
showCustomIconPosition: false,
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
+8
-8
@@ -15,24 +15,24 @@ export default createComponent({
|
||||
safeAreaInsetBottom: Boolean,
|
||||
closeIcon: {
|
||||
type: String,
|
||||
default: 'cross'
|
||||
default: 'cross',
|
||||
},
|
||||
closeIconPosition: {
|
||||
type: String,
|
||||
default: 'top-right'
|
||||
default: 'top-right',
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
default: 'center'
|
||||
default: 'center',
|
||||
},
|
||||
overlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
|
||||
beforeCreate() {
|
||||
@@ -71,7 +71,7 @@ export default createComponent({
|
||||
class={bem({
|
||||
round,
|
||||
[position]: position,
|
||||
'safe-area-inset-bottom': this.safeAreaInsetBottom
|
||||
'safe-area-inset-bottom': this.safeAreaInsetBottom,
|
||||
})}
|
||||
onClick={this.onClick}
|
||||
>
|
||||
@@ -88,5 +88,5 @@ export default createComponent({
|
||||
</div>
|
||||
</transition>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -18,8 +18,8 @@ test('reset z-index', () => {
|
||||
propsData: {
|
||||
value: true,
|
||||
zIndex: 10,
|
||||
lockScroll: false
|
||||
}
|
||||
lockScroll: false,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -28,8 +28,8 @@ test('reset z-index', () => {
|
||||
test('popup lock scroll', () => {
|
||||
const wrapper1 = mount(Popup, {
|
||||
propsData: {
|
||||
value: true
|
||||
}
|
||||
value: true,
|
||||
},
|
||||
});
|
||||
expect(document.body.classList.contains('van-overflow-hidden')).toBeTruthy();
|
||||
triggerDrag(document, 0, 100);
|
||||
@@ -37,8 +37,8 @@ test('popup lock scroll', () => {
|
||||
|
||||
const wrapper2 = mount(Popup, {
|
||||
propsData: {
|
||||
value: true
|
||||
}
|
||||
value: true,
|
||||
},
|
||||
});
|
||||
wrapper1.vm.$destroy();
|
||||
expect(document.body.classList.contains('van-overflow-hidden')).toBeTruthy();
|
||||
@@ -57,13 +57,13 @@ test('get container with parent', () => {
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
Popup
|
||||
Popup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
getContainer: () => div1
|
||||
getContainer: () => div1,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
const popup = wrapper.find('.van-popup').element;
|
||||
|
||||
@@ -83,8 +83,8 @@ test('get container with selector', () => {
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
Popup
|
||||
}
|
||||
Popup,
|
||||
},
|
||||
});
|
||||
|
||||
const dom1 = document.querySelector('.get-container-selector-1');
|
||||
@@ -103,13 +103,13 @@ test('render overlay', async () => {
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
Popup
|
||||
Popup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
getContainer: () => div
|
||||
getContainer: () => div,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -126,15 +126,15 @@ test('watch overlay prop', async () => {
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
Popup
|
||||
Popup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
show: false,
|
||||
overlay: false,
|
||||
getContainer: () => div
|
||||
getContainer: () => div,
|
||||
};
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -164,17 +164,17 @@ test('close on click overlay', async () => {
|
||||
</div>
|
||||
`,
|
||||
components: {
|
||||
Popup
|
||||
Popup,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: true,
|
||||
getContainer: () => div
|
||||
getContainer: () => div,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
onClickOverlay
|
||||
}
|
||||
onClickOverlay,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -198,8 +198,8 @@ test('open & close event', () => {
|
||||
test('click event', () => {
|
||||
const wrapper = mount(Popup, {
|
||||
propsData: {
|
||||
value: true
|
||||
}
|
||||
value: true,
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.trigger('click');
|
||||
@@ -210,8 +210,8 @@ test('duration prop', () => {
|
||||
const wrapper = mount(Popup, {
|
||||
propsData: {
|
||||
value: true,
|
||||
duration: 0.5
|
||||
}
|
||||
duration: 0.5,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -221,8 +221,8 @@ test('round prop', () => {
|
||||
const wrapper = mount(Popup, {
|
||||
propsData: {
|
||||
value: true,
|
||||
round: true
|
||||
}
|
||||
round: true,
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
@@ -232,8 +232,8 @@ test('closeable prop', () => {
|
||||
const wrapper = mount(Popup, {
|
||||
propsData: {
|
||||
value: true,
|
||||
closeable: true
|
||||
}
|
||||
closeable: true,
|
||||
},
|
||||
});
|
||||
|
||||
wrapper.find('.van-popup__close-icon').trigger('click');
|
||||
@@ -245,8 +245,8 @@ test('close-icon prop', () => {
|
||||
propsData: {
|
||||
value: true,
|
||||
closeable: true,
|
||||
closeIcon: 'success'
|
||||
}
|
||||
closeIcon: 'success',
|
||||
},
|
||||
});
|
||||
|
||||
expect(wrapper).toMatchSnapshot();
|
||||
|
||||
Reference in New Issue
Block a user