[Vuejs]-Vue.js conditional if else

0👍

try using computed property to provide boolean:

...
:style="[this.imageTest == true ? {} : 
{'url('+_CONFIG.media_url + content.Image +')') }]"
...

...
computed: {
   imageTest () {
      if (document.getElementById('idOfBackgroundImage') === $_.isEmpty(content.Image)) {
         return true;
      } else {
         return false;
      }
   }
}
...

Leave a comment