Skip to content

Instantly share code, notes, and snippets.

@c0depanda
Created January 6, 2019 03:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c0depanda/5cb9454298aba4bd8a162d93179dcd50 to your computer and use it in GitHub Desktop.
Save c0depanda/5cb9454298aba4bd8a162d93179dcd50 to your computer and use it in GitHub Desktop.
<template>
<main>
<h1>Cart Content</h1>
<p>Total Number of Items: {{totalNumberOfCartItems}}</p>
</main>
</template>
<script>
export default {
computed: {
totalNumberOfCartItems() {
// Accessing the Vuex state
return this.$store.getters.totalNumberOfCartItems;
}
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment