[Vuejs]-VueJS + V-IF : passing props gives container in computed?

1๐Ÿ‘

โœ…

As per documentation โ€“ computed properties do not accept arguments, as instead represent a variable with custom get and set methods. Meaning, computed properties are accessed, not invoked.

In your case methods should be used. It will be reactive and re-computed when argument changes.

methods: {
  hasWebsite (row) {
    return !!(row.status !== 100 && row.supplier.websiteUrl);
  }
}

Usage inside the template stays the same.

1๐Ÿ‘

You should use a method instead of computed property :

  methods: {
     hasWebsite: function(row){
      console.log(row)
      return !!(row.status !== 100 && row.supplier.websiteUrl);
   }

Leave a comment