Browse Source

refactor(nc-gui): revise imports

pull/6870/head
աɨռɢӄաօռɢ 11 months ago
parent
commit
75b7e84590
  1. 11
      packages/nc-gui/components/cell/DatePicker.vue

11
packages/nc-gui/components/cell/DatePicker.vue

@ -6,16 +6,22 @@ import {
ColumnInj,
EditColumnInj,
EditModeInj,
IsLockedInj,
ReadonlyInj,
computed,
inject,
isDateMonthFormat,
isDrawerOrModalExist,
onClickOutside,
onMounted,
onUnmounted,
parseProp,
ref,
useGlobal,
useI18n,
useSelectedCellKeyupListener,
watch,
} from '#imports'
import { isDateMonthFormat } from '~/utils'
interface Props {
modelValue?: string | null
@ -197,12 +203,15 @@ const updateOpen = (next: boolean) => {
}
const cellClickHook = inject(CellClickHookInj, null)
const cellClickHandler = () => {
open.value = (active.value || editable.value) && !open.value
}
onMounted(() => {
cellClickHook?.on(cellClickHandler)
})
onUnmounted(() => {
cellClickHook?.on(cellClickHandler)
})

Loading…
Cancel
Save