if ( event . keyCode == 13 ) { if ( ! event . metaKey ) { event . preventDefault ( ) ; this . changeSendOut ( ) ; } else { this . textarea = this . textarea + "\n" ; changeSendOut ( ) //发送短信函数

2.el-input,type="textarea"属性

       <el-input
            type="textarea"
            id="demoText"
            :rows="6"
            resize="none"
            v-model="textarea"
            @blur="handleInputBlur"
            @keydown.enter.native="carriageReturn($event)"
          ></el-input>
 // 回车发送消息
    carriageReturn(event) {
      let e = window.event || arguments[0];
      // console.log(e,e.keyCode)
      if (e.key == "Enter" || e.code == "Enter" || e.keyCode == 13) {
        e.returnValue = false;
        this.changeSendOut();
        return false;
                    直接看代码,文本框代码,下面是绑定的事件@keydown.enter="carriageReturn($event)"         &lt;textarea            style="              width: 100%;              height: 110px;              outline: none;              border: none;              resize: none;