Vue3中动态绑定:disabled element-plus使用方法

@change="whetherFlag($event)"  根据value值判断是否禁用 :disabled="isShow"

 
      
        
          
            
            
          
        
        
          
        
        
          
        
        
          
          
        
        
          
          
        
        
          
          
        

        
          
            取 消
             确 定 
          
        
      
    

初始值为禁用状态

const isShow = ref(true);

const isShow = ref(true);

 根据value的值判断是否禁用

// 状态判断
const whetherFlag = (value: string) => {
  if( value === "1" ) {
    isShow.value = false;
    console.log( isShow.value," isShow.value"); 
  }else {
    isShow.value = true;
  }
}

 

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