-
-
Save daanfl/d9c64892897f0ebc2c2db9d073e75704 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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