Remove the space check in the middle

1. Some need to remove spaces, .trim removes spaces before and after,

 

2. The verification of removing spaces in the middle

handleGoodsName(rule, value, callback) {

        let reg = /^[^\s]*$/;

        if (!value) callback(new Error('case name cannot be empty'))

        else if (reg.test(value)) callback()

        else callback(new Error('Case name cannot contain spaces'))

      },

 

 

Guess you like

Origin blog.csdn.net/weixin_62355341/article/details/126967209