[TS] Fix ts-strict errors in Vue components (Part 1) (#3119)

This commit is contained in:
Chenlei Hu
2025-03-17 21:15:00 -04:00
committed by GitHub
parent 329bdff677
commit 2db29fc2af
17 changed files with 60 additions and 42 deletions

View File

@@ -38,9 +38,10 @@ const props = withDefaults(defineProps<EditableTextProps>(), {
const emit = defineEmits(['update:modelValue', 'edit'])
const inputValue = ref<string>(props.modelValue)
const inputRef = ref(null)
const inputRef = ref<InstanceType<typeof InputText> | undefined>()
const blurInputElement = () => {
// @ts-expect-error - $el is an internal property of the InputText component
inputRef.value?.$el.blur()
}
const finishEditing = () => {
@@ -58,6 +59,7 @@ watch(
: inputValue.value
const start = 0
const end = fileName.length
// @ts-expect-error - $el is an internal property of the InputText component
const inputElement = inputRef.value.$el
inputElement.setSelectionRange?.(start, end)
})