mirror of
https://github.com/element-plus/element-plus.git
synced 2026-03-13 07:51:17 +08:00
style: arrow function (#982)
This commit is contained in:
@@ -112,7 +112,7 @@ export default defineComponent({
|
||||
return WEEKS_CONSTANT.concat(WEEKS_CONSTANT).slice(firstDayOfWeek, firstDayOfWeek + 7)
|
||||
})
|
||||
|
||||
const rows = computed(()=> {
|
||||
const rows = computed(() => {
|
||||
// TODO: refactory rows / getCellClasses
|
||||
const startOfMonth = props.date.startOf('month')
|
||||
const startOfMonthDay = startOfMonth.day() || 7 // day of first day
|
||||
|
||||
@@ -70,7 +70,7 @@ export default defineComponent({
|
||||
const tableRows = ref([ [], [], [] ])
|
||||
const lastRow = ref(null)
|
||||
const lastColumn = ref(null)
|
||||
const rows = computed(() =>{
|
||||
const rows = computed(() => {
|
||||
// TODO: refactory rows / getCellClasses
|
||||
const rows = tableRows.value
|
||||
const now = dayjs().startOf('month')
|
||||
|
||||
@@ -76,7 +76,7 @@ export default defineComponent({
|
||||
emits: ['pick'],
|
||||
|
||||
setup(props, ctx) {
|
||||
const startYear = computed(() =>{
|
||||
const startYear = computed(() => {
|
||||
return Math.floor(props.date.year() / 10) * 10
|
||||
})
|
||||
const getCellStyle = year => {
|
||||
|
||||
@@ -142,7 +142,7 @@ export default defineComponent({
|
||||
leftDate.value = leftDate.value.add(1, 'year')
|
||||
}
|
||||
|
||||
const rightPrevYear = () =>{
|
||||
const rightPrevYear = () => {
|
||||
rightDate.value = rightDate.value.subtract(1, 'year')
|
||||
}
|
||||
const leftLabel = computed(() => {
|
||||
@@ -153,7 +153,7 @@ export default defineComponent({
|
||||
return `${rightDate.value.year()} ${t('el.datepicker.year')}`
|
||||
})
|
||||
|
||||
const leftYear = computed(() =>{
|
||||
const leftYear = computed(() => {
|
||||
return leftDate.value.year()
|
||||
})
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export default defineComponent({
|
||||
|
||||
wrap.value[bar.value.scroll] = (thumbPositionPercentage * wrap.value[bar.value.scrollSize] / 100)
|
||||
}
|
||||
const startDrag = e =>{
|
||||
const startDrag = e => {
|
||||
e.stopImmediatePropagation()
|
||||
cursorDown.value = true
|
||||
on(document, 'mousemove', mouseMoveDocumentHandler)
|
||||
|
||||
@@ -353,7 +353,7 @@ export default defineComponent({
|
||||
ctx.emit('focus', e)
|
||||
}
|
||||
|
||||
const pickerDisabled = computed(() =>{
|
||||
const pickerDisabled = computed(() => {
|
||||
return props.disabled || elForm.disabled
|
||||
})
|
||||
|
||||
@@ -414,7 +414,7 @@ export default defineComponent({
|
||||
return props.prefixIcon || (isTimeLikePicker.value ? 'el-icon-time' : 'el-icon-date')
|
||||
})
|
||||
const showClose = ref(false)
|
||||
const onClearIconClick = event =>{
|
||||
const onClearIconClick = event => {
|
||||
if (props.readonly || pickerDisabled.value) return
|
||||
if (showClose.value) {
|
||||
event.stopPropagation()
|
||||
|
||||
@@ -136,13 +136,13 @@ export default defineComponent({
|
||||
const timePartsMap = computed(() => ({
|
||||
hours, minutes, seconds,
|
||||
}))
|
||||
const hoursList = computed(() =>{
|
||||
const hoursList = computed(() => {
|
||||
return getHoursList(props.role)
|
||||
})
|
||||
const minutesList = computed(() =>{
|
||||
const minutesList = computed(() => {
|
||||
return getMinutesList(hours.value, props.role)
|
||||
})
|
||||
const secondsList = computed(() =>{
|
||||
const secondsList = computed(() => {
|
||||
return getSecondsList(hours.value, minutes.value, props.role)
|
||||
})
|
||||
const listMap = computed(() => ({
|
||||
@@ -158,7 +158,7 @@ export default defineComponent({
|
||||
hour < 23 ? hour + 1 : undefined,
|
||||
]
|
||||
})
|
||||
const arrowMinuteList = computed(()=> {
|
||||
const arrowMinuteList = computed(() => {
|
||||
const minute = minutes.value
|
||||
return [
|
||||
minute > 0 ? minute - 1 : undefined,
|
||||
@@ -166,7 +166,7 @@ export default defineComponent({
|
||||
minute < 59 ? minute + 1 : undefined,
|
||||
]
|
||||
})
|
||||
const arrowSecondList = computed(() =>{
|
||||
const arrowSecondList = computed(() => {
|
||||
const second = seconds.value
|
||||
return [
|
||||
second > 0 ? second - 1 : undefined,
|
||||
@@ -189,7 +189,7 @@ export default defineComponent({
|
||||
return content
|
||||
}
|
||||
|
||||
const emitSelectRange = type =>{
|
||||
const emitSelectRange = type => {
|
||||
if (type === 'hours') {
|
||||
ctx.emit('select-range', 0, 2)
|
||||
} else if (type === 'minutes') {
|
||||
@@ -200,7 +200,7 @@ export default defineComponent({
|
||||
currentScrollbar.value = type
|
||||
}
|
||||
|
||||
const adjustCurrentSpinner = type =>{
|
||||
const adjustCurrentSpinner = type => {
|
||||
adjustSpinner(type, timePartsMap.value[type].value)
|
||||
}
|
||||
|
||||
@@ -221,7 +221,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
const typeItemHeight = type =>{
|
||||
const typeItemHeight = type => {
|
||||
const el = listRefsMap[type]
|
||||
return el.value.$el.querySelector('li').offsetHeight
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ export default defineComponent({
|
||||
const minDate = computed(() => props.parsedValue[0])
|
||||
const maxDate = computed(() => props.parsedValue[1])
|
||||
const oldValue = ref(props.parsedValue)
|
||||
const handleCancel = () =>{
|
||||
const handleCancel = () => {
|
||||
ctx.emit('pick', oldValue.value, null)
|
||||
}
|
||||
const showSeconds = computed(() => {
|
||||
|
||||
@@ -36,7 +36,7 @@ const router = createRouter({
|
||||
})
|
||||
app.use(ElementPlus)
|
||||
app.use(router)
|
||||
router.isReady().then(()=>{
|
||||
router.isReady().then(() => {
|
||||
|
||||
router.afterEach(async route => {
|
||||
await nextTick()
|
||||
|
||||
Reference in New Issue
Block a user