添加handleTextareaKeydown方法
<el-input
v-model.trim=”form.appDescript”
type=”textarea”
placeholder=”请输入应用简介”
maxlength=”250″
show-word-limit
rows=”4″
@keydown.enter.native=”handleTextareaKeydown”
/>
// 限制输入框换行操作
handleTextareaKeydown() {
const e = window.event || arguments[0]
if (e.key === ‘Enter’ || e.code === ‘Enter’ || e.keyCode === 13) {
e.returnValue = false
return false
}
},
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/279597.html