Skip to content

Instantly share code, notes, and snippets.

@daanfl
Created May 27, 2019 06:52
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 daanfl/d9c64892897f0ebc2c2db9d073e75704 to your computer and use it in GitHub Desktop.
Save daanfl/d9c64892897f0ebc2c2db9d073e75704 to your computer and use it in GitHub Desktop.
<template>
<div v-if="inStock.length">
<h1>Products in stock</h1>
<ul class="list">
<li v-for="product in inStock" :key="product.name">
{{ product.name }}
</li>
</ul>
</div>
</template>
<script>
import { mapGetters } from 'vuex'
export default {
computed: {
...mapGetters('products', [
'inStock',
]),
}
}
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment