How to disable input conditionally in vue.js

后端 未结 11 1266
余生分开走
余生分开走 2020-12-07 10:11

I have an input:



        
11条回答
  •  猫巷女王i
    2020-12-07 10:50

    Try this

     

    vue js

    new Vue({
      el: '#app',
      data: {
        terms: false
      },
      computed: {
        isDisabled: function(){
            return !this.terms;
        }
      }
    })
    

提交回复
热议问题