[Vuejs]-How to map through lodash and return false in the prop value

0👍

I’m going to assume packed will be 0 or 1 and not any other number. Vuejs has a problem with assigning both true and false in console, so instead I would suggest this. create a computed property that will check variable value of packed.

computed: {
   packStatus: function () {
     return this.packed !== 0 //this should return true if it's not 0, else return false
   }
}

and then you can pass the computed method return value by

<delivery-parcel :parcel="parcel" :index="index" :packed=packStatus></delivery-parcel>

Leave a comment