Vue-vue项目Element-UI 表单组件内容要求判断

 整体添加判断

    
        
          
        
        
          
            
          
        
        
          
        
        
          
        
      
import type { FormRules } from "element-plus";

const rules = ref({
  applyNum: [
    {
      required: true,
      message: "必填项",
      trigger: "change"
    },
    {
      message: "只能输入数字",
      trigger: "change",
      type: "number"
    },
    {
      message: "最小为1",
      trigger: "change",
      type: "number",
      min: 1
    }
  ]
});

interface Form {
  applyUsers: string;
  applyNum: Number;
  applyReason: string;
  uploadFiles: object;
}

const formModel = ref
({} as Form);

对应组件添加判断

Vue-vue项目Element-UI 表单组件内容要求判断_第1张图片

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