Browse Source

refactor(nc-gui): revise imports

pull/6870/head
աɨռɢӄաօռɢ 1 year 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, ColumnInj,
EditColumnInj, EditColumnInj,
EditModeInj, EditModeInj,
IsLockedInj,
ReadonlyInj, ReadonlyInj,
computed, computed,
inject, inject,
isDateMonthFormat,
isDrawerOrModalExist, isDrawerOrModalExist,
onClickOutside,
onMounted,
onUnmounted,
parseProp, parseProp,
ref, ref,
useGlobal,
useI18n,
useSelectedCellKeyupListener, useSelectedCellKeyupListener,
watch, watch,
} from '#imports' } from '#imports'
import { isDateMonthFormat } from '~/utils'
interface Props { interface Props {
modelValue?: string | null modelValue?: string | null
@ -197,12 +203,15 @@ const updateOpen = (next: boolean) => {
} }
const cellClickHook = inject(CellClickHookInj, null) const cellClickHook = inject(CellClickHookInj, null)
const cellClickHandler = () => { const cellClickHandler = () => {
open.value = (active.value || editable.value) && !open.value open.value = (active.value || editable.value) && !open.value
} }
onMounted(() => { onMounted(() => {
cellClickHook?.on(cellClickHandler) cellClickHook?.on(cellClickHandler)
}) })
onUnmounted(() => { onUnmounted(() => {
cellClickHook?.on(cellClickHandler) cellClickHook?.on(cellClickHandler)
}) })

Loading…
Cancel
Save