Typescript 4058 error for ref sugar
Version
3.2.32
Reproduction link
Steps to reproduce
i want to export a $ref variable,like this:
const num = $ref(0);
export default num;
What is expected?
no error
What is actually happening?
i got a ts 4058 error :
Exported variable 'num' has or is using name 'RefType' from external module "path/to/vue@3.2.32/node_modules/vue/macros" but cannot be named.
How can I fix this problem? thanks
BTW: You probably want to export
$$(num)
(the actual ref)
i know ,but this code i got the same error too , why ?
function useMouse() {
let x = $ref(0)
let y = $ref(0)
return $$({
x,
y
})
}
export default useMouse;
I am version 3.2.33, encountered the same problem as you, and then I got the latest version number, 3.2.37, after the upgrade can be
I am version 3.2.33, encountered the same problem as you, and then I got the latest version number, 3.2.37, after the upgrade can be
两个中国人在这说英语,难为你了哈哈哈哈
I am version 3.2.33, encountered the same problem as you, and then I got the latest version number, 3.2.37, after the upgrade can be
两个中国人在这说英语,难为你了哈哈哈哈
兄弟,我还有个问题 我生成.d.ts文件的时候全红,咋解决
I am version 3.2.33, encountered the same problem as you, and then I got the latest version number, 3.2.37, after the upgrade can be
两个中国人在这说英语,难为你了哈哈哈哈
兄弟,我还有个问题 我生成.d.ts文件的时候全红,咋解决
https://staging-cn.vuejs.org/guide/extras/reactivity-transform.html#explicit-opt-in 看文档就行了,我webstorm和vscode都能正常识别,或者你vue版本低了?