title: Disable input conditionally (Vue.js)
body: <p>I have an input:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;input 
    type=&quot;text&quot; 
    id=&quot;name&quot; 
    class=&quot;form-control&quot; 
    name=&quot;name&quot;  
    v-model=&quot;form.name&quot; 
    :disabled=&quot;validated ? '' : disabled&quot;
  /&gt;
  </code></pre>
  <p>and in my Vue.js component, I have:</p>
  <pre class="lang-js prettyprint-override"><code>..
  ..
  ready() {
    this.form.name = this.store.name;
    this.form.validated = this.store.validated;
  },
  ..
  </code></pre>
  <p><code>validated</code> being a <code>boolean</code>, it can be either <code>0</code> or <code>1</code>, but no matter what value is stored in the database, my input is always disabled.</p>
  <p>I need the input to be disabled if <code>false</code>, otherwise it should be enabled and editable.</p>
  <p>Update:</p>
  <p>Doing this always <strong>enables</strong> the input (no matter I have 0 or 1 in the database):</p>
  <pre class="lang-js prettyprint-override"><code>&lt;input 
    type=&quot;text&quot; 
    id=&quot;name&quot; 
    class=&quot;form-control&quot; 
    name=&quot;name&quot; 
    v-model=&quot;form.name&quot; 
    :disabled=&quot;validated ? '' : disabled&quot;
  /&gt;
  </code></pre>
  <p>Doing this always <strong>disabled</strong> the input (no matter I have 0 or 1 in  the database):</p>
  <pre class="lang-js prettyprint-override"><code>&lt;input 
    type=&quot;text&quot; 
    id=&quot;name&quot; 
    class=&quot;form-control&quot; 
    name=&quot;name&quot; 
    v-model=&quot;form.name&quot; 
    :disabled=&quot;validated ? disabled : ''&quot;
  /&gt;
  </code></pre>