I need that when a user clicks a button on the child component the parent component receives cart.lenght
to be assigned the count
property of an element.
Child component code
<q-btn flat round color="faded" icon="fas fa-shopping-cart" @click="cart(item.id)"/>
cart: function (Id) {
let cart = []
cart.push(Id)
this.$emit('totalItensCart')
this.$q.localStorage.set('cart', cart)
}
How do I display the cart.length
value in the count
property that is in the parent component?
Parent component code
<q-route-tab
count="5"
icon="fas fa-cart-plus"
to="/cart"
exact
slot="title"/>