|
|
|
@ -15,12 +15,23 @@ const setActiveCalendarMode = (mode: 'day' | 'week' | 'month' | 'year', event: M
|
|
|
|
|
highlightStyle.value.left = `${tabElement.offsetLeft}px` |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
const updateHighlightPosition = () => { |
|
|
|
|
nextTick(() => { |
|
|
|
|
const activeTab = document.querySelector('.nc-calendar-mode-tab .tab.active') as HTMLElement |
|
|
|
|
if (activeTab) { |
|
|
|
|
highlightStyle.value.left = `${activeTab.offsetLeft}px` |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
onMounted(() => { |
|
|
|
|
updateHighlightPosition() |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
watch(activeCalendarView, () => { |
|
|
|
|
if (!props.tab) return |
|
|
|
|
updateHighlightPosition() |
|
|
|
|
}) |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
@ -37,7 +48,7 @@ onMounted(() => {
|
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div v-else> |
|
|
|
|
<NcDropdown trigger="click"> |
|
|
|
|
<NcDropdown :trigger="['click']"> |
|
|
|
|
<NcButton size="small" type="secondary"> |
|
|
|
|
{{ $t(`objects.${activeCalendarView}`) }} |
|
|
|
|
<component :is="iconMap.arrowDown" /> |
|
|
|
|