The input box uses regular expressions to check the input value, and the tree point is deleted when it is deleted.

use the custom verification rules in elementui"s form to check the input numbers, but when you delete using the Backoff / Delete key, the decimal point is deleted together. I don"t know why, but regular expressions can currently meet the verification requirements. I don"t know if regularities are relevant. The code is as follows

let fnArgCheckDutyPercent = (rule, value, callback) => {
      let regDecimal = /^[\d{1,3}]+(\.\d{1,2})?$/;
      if (!value) {
        callback(new Error(""));
      } else if (!regDecimal.test(value)) {
        callback(new Error(""));
      } else {
        callback();
      }
    };
{ validator: fnArgCheckDutyPercent, trigger: "blur" }

the


problem has been solved because model in the template template adds the number modifier, 123. Will be automatically converted to


the first big shot has already raised a question.
regDecimal = / ^ [d {1Magne 3}] + (.d {1jue 2})? $/
change it to: regDecimal = / ^ d + (.d {1jue 2})? $/

clipboard.png

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-1b351b6-e4b8.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-1b351b6-e4b8.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?