Browse Source

chore(gui-v2): fix types in Text & TextArea

pull/3044/head
braks 2 years ago
parent
commit
068075806f
  1. 3
      packages/nc-gui-v2/components/cell/Text.vue
  2. 7
      packages/nc-gui-v2/components/cell/TextArea.vue

3
packages/nc-gui-v2/components/cell/Text.vue

@ -1,4 +1,5 @@
<script setup lang="ts">
import type { VNodeRef } from '@vue/runtime-core'
import { inject, ref, useVModel } from '#imports'
import { EditModeInj } from '~/context'
@ -14,7 +15,7 @@ const editEnabled = inject(EditModeInj, ref(false))
const vModel = useVModel(props, 'modelValue', emits)
const focus = (el: HTMLInputElement) => el?.focus()
const focus: VNodeRef = (el) => (el as HTMLInputElement)?.focus()
</script>
<template>

7
packages/nc-gui-v2/components/cell/TextArea.vue

@ -1,4 +1,5 @@
<script setup lang="ts">
import type { VNodeRef } from '@vue/runtime-core'
import { inject, ref, useVModel } from '#imports'
import { EditModeInj } from '~/context'
@ -6,7 +7,9 @@ interface Props {
modelValue: string | null
}
const props = defineProps<Props>()
const props = withDefaults(defineProps<Props>(), {
modelValue: '',
})
const emits = defineEmits(['update:modelValue'])
@ -14,7 +17,7 @@ const editEnabled = inject(EditModeInj, ref(false))
const vModel = useVModel(props, 'modelValue', emits)
const focus = (el: HTMLTextAreaElement) => el?.focus()
const focus: VNodeRef = (el) => (el as HTMLTextAreaElement)?.focus()
</script>
<template>

Loading…
Cancel
Save