[Vuejs]-Loading and rendered state component Vue

0๐Ÿ‘

If the cart is stored in vuex store, you access it by calling

this.$store.state.carts

0๐Ÿ‘

Use computed section to get the datas from your store:

computed: {
        getCarts(){
          return this.$store.state.carts
        }
      }

right now update your template:

<PageContainer :isLoading="getCarts.loading" :isError="getCarts.error">
    <div>{{ getCarts.data.name }}</div>
  </PageContainer>

Leave a comment