[Vuejs]-Why does my computed property's state show as blank in mounted hook, but fine everywhere else?

0👍

Sounds like a “this scope” problem.

Try with

computed: mapState({
orderTitle (state) {
return state.order.bookTitle
}
}),

👤rick

0👍

I figured it out. Instead of performing the actions in the mounted hook, I did it in the updated hook, which fires much later in the Vue instance lifecycle (after the Virtual DOM is re-rendered & patched).

👤Kopty

Leave a comment