How to disable input conditionally in vue.js

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

I have an input:



        
11条回答
  •  不思量自难忘°
    2020-12-07 10:47

    you could have a computed property that returns a boolean dependent on whatever criteria you need.

    
    

    then put your logic in a computed property...

    computed: {
      isDisabled() {
        // evaluate whatever you need to determine disabled here...
        return this.form.validated;
      }
    }
    

提交回复
热议问题