How to add two different verification methods in the case of vue structure

 <el-form-item label=":" class="coupon-short" prop="cpName" :inline-message="true" ref="cpName">
        <el-input v-if="form.cpType !== 2" placeholder="" v-model="form.cpName" :maxlength="20"></el-input>
        <template v-else>
          <span>{{form.cpName}}</span>
          <el-button type="text" @click="openChooseGood("chooseGood", form.checkedGood)"></el-button>
        </template>
      </el-form-item>

prop= "cpName" this check can check illegal characters

now you want to implement v-else without verifying this illegal character

how to implement

Mar.04,2021

use custom proofreading rules

data () {
    let check = (rule, value, callback) => {
        if (this.form.cpType !== 2) {
            ......cpName
            if (value === '' || ....) {
                callback(new Error(''))
            } else {
                callback()
            }
        }
        callback()
    }
    return: {
        rule: {
            cpName: [
                {validator: check , trigger: 'blur'}
            ]
        }
    }
}
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b32f2c-4d4f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b32f2c-4d4f3.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?