在quill的配置中配置keyboard
editorOptions: {
placeholder: '',
theme: 'snow', // or 'bubble'
modules: {
keyboard: {
bindings: {
shift_enter: {
key: 13,
shiftKey: true,
handler: (range, ctx) => {
console.log(range, ctx); // if you want to see the output of the binding
this.editor.insertText(range.index, '\n');
}
},
enter: {
key: 13,
handler: () => { // submit form }
this.$emit('sendMsg')
}
}
}
},
}
},