-
-
Notifications
You must be signed in to change notification settings - Fork 487
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
<template>
<ul :ref="el => state.element = el"></ul>
</template>
<script lang="ts" setup>
import { ref } from 'vue'
const state = ref<{ element: Element }>({ element: null })
</script>This will produce error because ComponentInternalInstance | Element cannot be assigned to Element.
However we can infer the real :ref is string | Ref<any> | ((ref: HTMLUListElement) => void) instead of string | Ref<any> | ((ref: ComponentInternalInstance | Element) => void) because ul is hard-coded.
Or, can we prevent the error message by <!-- @ts-ignore --> or something?
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested