自动计算比例 计算属性 computed @input=“rate“

   
          
            
              
            
          
        

        
          
            
              
            
          
        

        
          
            
              
            
          
        
  computed: {
    rate() {
      if (this.createForm.cumulativeRent && this.createForm.contractRent) {
        this.createForm.returnRate =
          parseFloat(
            this.createForm.cumulativeRent / this.createForm.contractRent
          ).toFixed(4) * 100;
      }
    }
  },

 

你可能感兴趣的:(vue,vue.js,elementui,javascript)