Currently, I am working on developing a web application using VUE Vite with a router
and store
. The getter function in the vue file is functioning properly, giving me access to the chatMessages
stored in the store.js file.
However, my challenge lies in calling the addMessage
Action from the store.js file through the browser's dev console. How can I achieve this?
In older versions of Vue, this process would involve the use of the main.js file as shown below:
(Vue code snippet example)
Current setup in vue3 chat.vue file:
(Vue code snippet for chat.vue file)
Current setup in vue3 store.js file:
(Vue code snippet for store.js file)
Current setup in vue3 main.js file:
(Vue code snippet for main.js file)
EDIT: After testing a new approach, where I could call app.addMessage from the dev console successfully, I encountered an issue with the router functionality being affected.
(Updated Vue code snippet example)