Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<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