$toRef is not available unless $ref is also used
Vue version
3.2.37
Link to minimal reproduction
Steps to reproduce
- Write a new component that makes use of $toRef but does not use $ref
- You'll see the following error:
$toRef is not defined
What is expected?
Transform kicks in when $toRef is used.
What is actually happening?
Transformation of $toRef does not happen unless the same file uses $ref.
It does not seem to matter whether $ref is used in a commented line of code.
System Info
No response
Any additional comments?
Related discussion: https://github.com/vuejs/rfcs/discussions/369#discussioncomment-3204419
Unfortunately, Reactivity Transform has been dropped officially now, so I closed this issue/PR. If you want to keep using it, please consider the community version Vue Macros.
This PR has been merged to Vue Macros https://github.com/sxzz/unplugin-vue-macros/commit/8cc7b4cec38034540f7fecae0626965a9b1e7171.