2π
β
I would make a computed
property named isProcessing
:
- Return
true
if thereβs at least one product is being processed. - Return
false
otherwise.
In the template, use v-if='isProcessing'
to show There is not product being processed
and v-else
to show list of products which are being processed.
computed: {
isProcessing: function () {
return this.products.find( product => product.status === 'processing' ) !== undefined
}
}
π€dvnguyen
Source:stackexchange.com