How to display props in filteredProducts when using axios to get data. I have passed the props as shown below.
export default { data() { return { filteredProducts: [], }; }, mounted() { axios .get('/src/stores/sneakers.json') .then(response => { const products = response.data this.filteredProducts = products.filter(product => product.name.includes('Nike')) }) }, computed: { resultCount () { return Object.keys(this.filteredProducts).length }, }, props: { brand: { type: Object, }, },
I want to replace "Nike" with the brand name being passed. Thank you so much
Select the product named "Nike" and pass it into
filteredProducts
. Afterwards you can change the name using a computed property and use it in the template.