vue elment 表格内表单校验代码


  <p v-if="scope.row.id">
                  {{ scope.row.bidderCode }}
                </p>
                <el-form-item
                  class="formitem"
                  v-else
                  :prop="'bidderCode' + scope.row.id"
                  :rules="getValidationRules('投标人/供应商代码', scope.row.id)"
                >
                  <el-input v-model="scope.row.bidderCode"></el-input>
                </el-form-item>

  methods: {
    getValidationRules(fieldName, id) {
      return [
        {
          required: true,
          message: fieldName,
          trigger: 'blur',
          field: fieldName + id
        }
      ]
    },


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