Browse Source

fix(nc-gui): calendar mode node updating in ui

pull/7611/head
DarkPhoenix2704 9 months ago
parent
commit
068d425ce1
  1. 15
      packages/nc-gui/components/smartsheet/toolbar/CalendarMode.vue

15
packages/nc-gui/components/smartsheet/toolbar/CalendarMode.vue

@ -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" />

Loading…
Cancel
Save