Why can't the getter of vuex get the latest properties? The state of vuex has changed but the getter is not updated

 

Up to 30% off on Alibaba Cloud servers

Problem background:

     

<newer :newrModalShow="$store.getters['order/getNewer']"  v-if="newerDatas" :newerDatas="newerDatas"  />

  As above: a page introduces a component, through the vuex state to control the display and hide, the state viewed through the browser has changed, but the getter does not get the latest state

solve:

import {mapState} from 'vuex'
computed: {
  ...mapState({
    'isnewer':state => state.order.isnewer
  }),
}
<newer v-if="newerDatas" v-show="isnewer" :newerDatas="newerDatas" />

Don't hide it privately, present a collection: http://raboninco.com/1MsLW

Guess you like

Origin blog.csdn.net/z00001993/article/details/105812017