use vee-validate "s regular verification rules in vue projects. The backend returns tailZeroCount, and then dynamically generates regular expressions, as follows:
regexRule() {
let tailZeroCount = this.warePublishData.warePublishVO.tailZeroCount ? this.warePublishData.warePublishVO.tailZeroCount : 3
return /^[0-9]*[0]{`tailZeroCount`}$/
}
<input type="text" v-validate="{
required: true,
regex: regexRule
}"/>
but the printed regexRule is still / ^ [0-9] * [0] {
tailZeroCount } $/