[Vuejs]-Then I reload page v-if(with computed data) not work

0👍

Your basic setup is correct. That v-if should work if the data-flow is correct.

From what you’re giving us, I see the following:

In your computed property you’re looking at: this.$store.state.dataList.orders

In your mutation you’re changing state. orders. This should be state.dataList.orders.

In other words: you should check whether the state has the shape you expect it to have. You can do this with a console.log in the computed property, or one in the mutation.

Leave a comment