chore: add trailingComma
This commit is contained in:
@@ -6,7 +6,7 @@ const [createComponent] = createNamespace('calendar-header');
|
||||
export default createComponent({
|
||||
props: {
|
||||
title: String,
|
||||
monthTitle: String
|
||||
monthTitle: String,
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -29,7 +29,7 @@ export default createComponent({
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
@@ -40,5 +40,5 @@ export default createComponent({
|
||||
{this.genWeekDays()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -15,12 +15,12 @@ export default createComponent({
|
||||
showTitle: Boolean,
|
||||
rowHeight: Number,
|
||||
formatter: Function,
|
||||
currentDate: [Date, Array]
|
||||
currentDate: [Date, Array],
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
visible: false
|
||||
visible: false,
|
||||
};
|
||||
},
|
||||
|
||||
@@ -43,7 +43,7 @@ export default createComponent({
|
||||
Math.ceil((this.totalDay + this.offset) / 7) * this.rowHeight;
|
||||
|
||||
return {
|
||||
paddingBottom: `${padding}px`
|
||||
paddingBottom: `${padding}px`,
|
||||
};
|
||||
}
|
||||
},
|
||||
@@ -61,7 +61,7 @@ export default createComponent({
|
||||
date,
|
||||
type,
|
||||
text: day,
|
||||
bottomInfo: this.getBottomInfo(type)
|
||||
bottomInfo: this.getBottomInfo(type),
|
||||
};
|
||||
|
||||
if (this.formatter) {
|
||||
@@ -72,7 +72,7 @@ export default createComponent({
|
||||
}
|
||||
|
||||
return days;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -219,7 +219,7 @@ export default createComponent({
|
||||
{BottomInfo}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
@@ -229,5 +229,5 @@ export default createComponent({
|
||||
{this.genDays()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -129,7 +129,7 @@ export default {
|
||||
customPosition: '自定义弹出位置',
|
||||
customCalendar: '自定义日历',
|
||||
confirmDisabledText: '请选择结束时间',
|
||||
tiledDisplay: '平铺展示'
|
||||
tiledDisplay: '平铺展示',
|
||||
},
|
||||
'en-US': {
|
||||
in: 'In',
|
||||
@@ -150,8 +150,8 @@ export default {
|
||||
customPosition: 'Custom Position',
|
||||
customCalendar: 'Custom Calendar',
|
||||
confirmDisabledText: 'Select End Time',
|
||||
tiledDisplay: 'Tiled display'
|
||||
}
|
||||
tiledDisplay: 'Tiled display',
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
@@ -166,7 +166,7 @@ export default {
|
||||
customConfirm: [],
|
||||
customRange: null,
|
||||
customDayText: [],
|
||||
customPosition: null
|
||||
customPosition: null,
|
||||
},
|
||||
type: 'single',
|
||||
round: true,
|
||||
@@ -281,7 +281,7 @@ export default {
|
||||
onConfirm(date) {
|
||||
this.showCalendar = false;
|
||||
this.date[this.id] = date;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
+21
-21
@@ -8,7 +8,7 @@ import {
|
||||
compareMonth,
|
||||
createComponent,
|
||||
calcDateNum,
|
||||
ROW_HEIGHT
|
||||
ROW_HEIGHT,
|
||||
} from './utils';
|
||||
|
||||
import Popup from '../popup';
|
||||
@@ -29,12 +29,12 @@ export default createComponent({
|
||||
confirmDisabledText: String,
|
||||
type: {
|
||||
type: String,
|
||||
default: 'single'
|
||||
default: 'single',
|
||||
},
|
||||
minDate: {
|
||||
type: Date,
|
||||
validator: isDate,
|
||||
default: () => new Date()
|
||||
default: () => new Date(),
|
||||
},
|
||||
maxDate: {
|
||||
type: Date,
|
||||
@@ -42,50 +42,50 @@ export default createComponent({
|
||||
default() {
|
||||
const now = new Date();
|
||||
return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate());
|
||||
}
|
||||
},
|
||||
},
|
||||
position: {
|
||||
type: String,
|
||||
default: 'bottom'
|
||||
default: 'bottom',
|
||||
},
|
||||
rowHeight: {
|
||||
type: Number,
|
||||
default: ROW_HEIGHT
|
||||
default: ROW_HEIGHT,
|
||||
},
|
||||
round: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
poppable: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
showMark: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
showConfirm: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
safeAreaInsetBottom: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
closeOnClickOverlay: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
default: true,
|
||||
},
|
||||
maxRange: {
|
||||
type: Number,
|
||||
default: null
|
||||
}
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
monthTitle: '',
|
||||
currentDate: this.getInitialDate()
|
||||
currentDate: this.getInitialDate(),
|
||||
};
|
||||
},
|
||||
|
||||
@@ -114,7 +114,7 @@ export default createComponent({
|
||||
}
|
||||
|
||||
return !this.currentDate;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
watch: {
|
||||
@@ -129,7 +129,7 @@ export default createComponent({
|
||||
|
||||
defaultDate(val) {
|
||||
this.currentDate = val;
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
mounted() {
|
||||
@@ -331,7 +331,7 @@ export default createComponent({
|
||||
return (
|
||||
<div
|
||||
class={bem('footer', {
|
||||
'safe-area-inset-bottom': this.safeAreaInsetBottom
|
||||
'safe-area-inset-bottom': this.safeAreaInsetBottom,
|
||||
})}
|
||||
>
|
||||
{this.genFooterContent()}
|
||||
@@ -346,7 +346,7 @@ export default createComponent({
|
||||
title={this.title}
|
||||
monthTitle={this.monthTitle}
|
||||
scopedSlots={{
|
||||
title: () => this.slots('title')
|
||||
title: () => this.slots('title'),
|
||||
}}
|
||||
/>
|
||||
<div ref="body" class={bem('body')} onScroll={this.onScroll}>
|
||||
@@ -355,7 +355,7 @@ export default createComponent({
|
||||
{this.genFooter()}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
},
|
||||
},
|
||||
|
||||
render() {
|
||||
@@ -377,5 +377,5 @@ export default createComponent({
|
||||
}
|
||||
|
||||
return this.genCalendar();
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -23,8 +23,8 @@ test('select event when type is single', async () => {
|
||||
propsData: {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -43,8 +43,8 @@ test('select event when type is range', async () => {
|
||||
type: 'range',
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -68,8 +68,8 @@ test('should not trigger select event when click disabled day', async () => {
|
||||
propsData: {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -87,8 +87,8 @@ test('confirm event when type is single', async () => {
|
||||
propsData: {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -110,8 +110,8 @@ test('confirm event when type is range', async () => {
|
||||
type: 'range',
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -131,8 +131,8 @@ test('confirm event when type is range', async () => {
|
||||
test('default single date', async () => {
|
||||
const wrapper = mount(Calendar, {
|
||||
propsData: {
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -145,8 +145,8 @@ test('default range date', async () => {
|
||||
const wrapper = mount(Calendar, {
|
||||
propsData: {
|
||||
type: 'range',
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -163,8 +163,8 @@ test('reset method', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
type: 'range',
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -188,8 +188,8 @@ test('set show-confirm to false', async () => {
|
||||
maxDate,
|
||||
type: 'range',
|
||||
poppable: false,
|
||||
showConfirm: false
|
||||
}
|
||||
showConfirm: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -209,8 +209,8 @@ test('row-height prop', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false,
|
||||
rowHeight: 50
|
||||
}
|
||||
rowHeight: 50,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -243,8 +243,8 @@ test('formatter prop', async () => {
|
||||
}
|
||||
|
||||
return day;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -257,12 +257,12 @@ test('title & footer slot', async () => {
|
||||
propsData: {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
poppable: false,
|
||||
},
|
||||
scopedSlots: {
|
||||
title: () => 'Custom Title',
|
||||
footer: () => 'Custom Footer'
|
||||
}
|
||||
footer: () => 'Custom Footer',
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -275,8 +275,8 @@ test('should reset when type changed', async () => {
|
||||
propsData: {
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -297,8 +297,8 @@ test('default-date prop in single type', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
defaultDate: getNextDay(minDate),
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -317,8 +317,8 @@ test('default-date prop in range type', async () => {
|
||||
type: 'range',
|
||||
minDate,
|
||||
maxDate,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -340,13 +340,13 @@ test('popup wrapper', async () => {
|
||||
const wrapper = mount(Calendar, {
|
||||
propsData: {
|
||||
minDate,
|
||||
maxDate
|
||||
maxDate,
|
||||
},
|
||||
listeners: {
|
||||
input(value) {
|
||||
wrapper.setProps({ value });
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -367,8 +367,8 @@ test('set show-mark prop to false', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
showMark: false,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -382,8 +382,8 @@ test('color prop when type is single', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
color: 'blue',
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -399,8 +399,8 @@ test('color prop when type is range', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
color: 'blue',
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
@@ -414,8 +414,8 @@ test('should scroll to current month when show', async done => {
|
||||
type: 'range',
|
||||
minDate: new Date(2010, 0, 10),
|
||||
maxDate: new Date(2010, 11, 10),
|
||||
defaultDate: [new Date(2010, 3, 1), new Date(2010, 5, 1)]
|
||||
}
|
||||
defaultDate: [new Date(2010, 3, 1), new Date(2010, 5, 1)],
|
||||
},
|
||||
});
|
||||
|
||||
Element.prototype.scrollIntoView = function() {
|
||||
@@ -435,8 +435,8 @@ test('max-range prop', async () => {
|
||||
minDate,
|
||||
maxDate,
|
||||
maxRange: 1,
|
||||
poppable: false
|
||||
}
|
||||
poppable: false,
|
||||
},
|
||||
});
|
||||
|
||||
await later();
|
||||
|
||||
Reference in New Issue
Block a user