js prohibit emoticons

It is forbidden to input emoticons, if the input emoticon is set to empty

 checkInput(value) {
      // 判断是否含有emoji表情
      let iconRule = /[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/ig
      // 如果为true,字符串含有emoji表情 ,false不含
      if (iconRule.test(value)) {
       // warnAlert("不支持发送表情")  
        this.smsContent = this.smsContent.replace(iconRule, '')
        return
      }
    },

Guess you like

Origin blog.csdn.net/enhenglhm/article/details/128075373