shallowRef Vue Component inside store #2449
Unanswered
JK-Effects
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I am building a custom ContextMenu for which I am saving the state in pinia. So that I can display content in my ContextMenu, I am passing a Vue component as shallowref to the store.
Now to my problem:
In dev mode, pinia displays the component_ref state-variable as a null value in the dev tools. Even if I output the value in the UI, nothing is displayed. When I output the values in the openContextMenu function via the console, I do not get null values.
This happens when I pass a shallowRef component. If I pass the component directly, everything works. (The console warns against direct passing).
Sometimes the content is also displayed when I change a file and the app partially reloads.
If I build the application for production and then test it, shallowref works without problems.
Code:
store
Component to open ContextMenu
contextMenu
Warning:
Versions:
Vue: 3.3.4 (with typescript)
Vite: 4.4.9
Pinia: 2.1.6
Does anyone know why the component cannot be displayed in dev mode?
Beta Was this translation helpful? Give feedback.
All reactions