2

How can I disable an input box via clicking a button and toggling it using vuejs 2.0

1 Answer 1

10

You can bind disabled, see an example:

new Vue({

  el: '#app',
  data: {
    isDisabled: false
  }

})
<script src="https://unpkg.com/vue/dist/vue.js"></script>
<div id="app">

  <input type="text" :disabled="isDisabled">
  <button @click="isDisabled = !isDisabled">Click</button>

</div>

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.