New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error with storeToRefs
in Vue 2
#852
Comments
This is because of vuejs/composition-api#844, use |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
If this is an issue on Vue end, and it won't work until this bug is fixed, then it would be great to update Pinia docs so that people are not expecting this feature to work with Vue 2.x |
Does not solve the issue for me, or I'm doing it wrong. Are you saying to simply replace storeToRefs with toRefs? Cause that still gives me an undefined. |
For the moment, I think the best is to add a runtime dev-only warning if the user is using Vue 2 that says this feature is not supported, recommend them to use |
That's a good idea. |
Can we use other ways to avoid it first?
|
work well with store which defined by use function(setup style)? |
Reproduction
https://github.com/Djaler/pinia-vue-2-store-to-refs
Steps to reproduce the behavior
Expected behavior
Two numbers displayed beside a button.
Actual behavior
Value, created using
storeToRefs
is undefinedAdditional information
If we debug
storeToRefs
function, we'll see thatstore['counter']
is just a plain number, not a ref.The text was updated successfully, but these errors were encountered: