其他分享
首页 > 其他分享> > vue 前端校验

vue 前端校验

作者:互联网

        <el-form-item label="重量(Kg)" prop="trainWeight">
          <el-input
            v-model="objData.trainWeight"
            placeholder="请输入重量"
            style="width: 80%"
          />
        </el-form-item>
data(){
return {trainWeight: null}
}
objData: {

        trainWeight: undefined,
      }
rules: {
        trainWeight: [{ required: true, message: '重量不能为空', trigger: 'blur' }]
      },
 <el-form
        ref="dataForm"
        :rules="rules"
        :model="objData"
        label-width="80px"
        style="width: 80%; margin-left: 50px"
      >

</el-form>

 

标签:objData,vue,return,trainWeight,rules,前端,校验,true
来源: https://www.cnblogs.com/tszr/p/16283183.html