ElementUI textarea禁止换行槽子哦
作者:互联网
添加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
}
},
标签:handleTextareaKeydown,code,false,槽子,textarea,ElementUI,换行,输入框,Enter 来源: https://www.cnblogs.com/zerofan/p/16563199.html