title: One line condition not working in data in Vue js
body: <p>I have a component that is going to have data named <code>isVendorOrAgent</code> that should be <code>false</code> or <code>true</code> based on a property that the component gets. When I put this condition on the data section of the component, it doesn't work and always returns <code>false</code> but when I put that in <code>created()</code> and change the <code>isVendorOrAgent</code> in <code>created()</code>, it works.</p>
  
  <p>How can I make this work?</p>
  
  <p>This is the condition that is not working:</p>
  
  <pre><code>data : () =&gt; {
     return {
        isVendorOrAgent : (this.entityName == "vendor" || this.entityName == "agent") ? true : false;
     }
  }
  </code></pre>
  
  <p>but this works when the default is false:</p>
  
  <pre><code>created(){
      if(this.entityName == "vendor" || this.entityName == "agent"){
        this.isVendorOrAgent = true;
      }
    }
  </code></pre>