Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何通过单击按钮并使用 vuejs 2.0 切换来禁用输入框
你可以绑定disabled,看一个例子:
disabled
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>