[Vuejs]-Toggle Switch can be enabled if a text box is filled in

0👍

Elaborating on the comment, please check this quick demo about how to set disabled attribute dynamically.

  <div id="app">
    <div>Input: <input v-model="inputVal" /></div>
    <div>
      Checkbox:
      <input
        type="checkbox"
        :disabled="inputVal === ''"
        v-model="checkboxVal"
      />
    </div>
  </div>

Related docs: passing a boolean

Leave a comment