0👍
-
If you are saying "how can I pass an
orderBy
value to theordering-filters
instance", then you are looking forprops
.props: {
orderBy: {
type: String,
required: true
}
}
Then
<ordering-filters :order-by="someStringVal"></ordering-filters>
-
For your second question, you don’t necessarily need
isActive
.<a href="#" :class="{‘active’ : order === ‘asc’}"
@click="orderCountries({orderBy, order: ‘asc’})">
<a href="#" :class="{‘active’ : order === ‘desc’}"
@click="orderCountries({orderBy, order: ‘desc’})">methods: {
orderCountries(params){
this.order = params.order
}
}
Source:stackexchange.com