能解释一下我在下面看到的错误吗?如果我使用ref(NULL),我会得到这个错误,但对于任何我不会得到的东西.调用NULL并避免错误的正确方法是什么?
Property 'scrollHeight' does not exist on type 'never'.
Property 'clientHeight' does not exist on type 'never'.个
const information = ref(null) // Throws error
const information = ref() // No error
function informationRefStatus() {
const element = information.value
isTextTruncated.value = element?.scrollHeight > element?.clientHeight
}