diff --git a/packages/nc-gui-v2/components/cell/TextArea.vue b/packages/nc-gui-v2/components/cell/TextArea.vue index d27590877d..4552706231 100644 --- a/packages/nc-gui-v2/components/cell/TextArea.vue +++ b/packages/nc-gui-v2/components/cell/TextArea.vue @@ -5,70 +5,43 @@ interface Props { modelValue?: string } -const { modelValue: value } = defineProps() +const props = defineProps() -const emit = defineEmits(['update:modelValue']) +const emits = defineEmits(['update:modelValue']) const editEnabled = inject('editEnabled', false) const root = ref() -const localState = computed({ - get: () => value, - set: (val) => emit('update:modelValue', val), -}) +const vModel = useVModel(props, 'modelValue', emits) onMounted(() => { root.value?.focus() }) -/* export default { - name: 'TextAreaCell', - props: { - value: String, - }, - computed: { - localState: { - get() { - return this.value - }, - set(val) { - this.$emit('input', val) - }, - }, - parentListeners() { - const $listeners = {} - - if (this.$listeners.blur) { - $listeners.blur = this.$listeners.blur - } - if (this.$listeners.focus) { - $listeners.focus = this.$listeners.focus - } - - return $listeners - }, - }, - created() { - this.localState = this.value - }, - mounted() { - this.$refs.textarea && this.$refs.textarea.focus() +watch( + () => root.value, + (el) => { + el?.focus() }, -} */ +)