Browse Source

chore(nc-gui): cleanup text area cell

pull/3801/head
braks 2 years ago
parent
commit
2e07a32bb0
  1. 13
      packages/nc-gui/components/cell/TextArea.vue

13
packages/nc-gui/components/cell/TextArea.vue

@ -1,21 +1,16 @@
<script setup lang="ts"> <script setup lang="ts">
import type { VNodeRef } from '@vue/runtime-core' import type { VNodeRef } from '@vue/runtime-core'
import { EditModeInj, computed, inject } from '#imports' import { EditModeInj, inject, useVModel } from '#imports'
interface Props { const props = defineProps<{
modelValue?: string | null modelValue?: string | null
} }>()
const { modelValue } = defineProps<Props>()
const emits = defineEmits(['update:modelValue']) const emits = defineEmits(['update:modelValue'])
const editEnabled = inject(EditModeInj) const editEnabled = inject(EditModeInj)
const vModel = computed({ const vModel = useVModel(props, 'modelValue', emits, { defaultValue: '' })
get: () => modelValue ?? '',
set: (value) => emits('update:modelValue', value),
})
const focus: VNodeRef = (el) => (el as HTMLTextAreaElement)?.focus() const focus: VNodeRef = (el) => (el as HTMLTextAreaElement)?.focus()
</script> </script>

Loading…
Cancel
Save