How to disable Input conditionally in Vue.js
In this post we will give you information about How to disable Input conditionally in Vue.js. Hear we will give you detail about How to disable Input conditionally in Vue.jsAnd how to use it also give you demo for it if it is necessary.
This example shows you how to disable the input box conditionally in vue.js.
<template> <div id="app"> <input type="text" :disabled="disabled" v-model="text"> <button @click="disabled=!disabled">Toggle Enable</button> </div></template><script>export default { data() { return { text: "", disabled: false }; }};</script>
Explanation
We can disable the input box by passing a boolean value true.
In the above code we have passed disabled property to the input disabled attribute by using the Toggle button we are the changing the disabled property value to true.
Hope this code and post will helped you for implement How to disable Input conditionally in Vue.js. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs