How can I disable an input box via clicking a button and toggling it using vuejs 2.0
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With