<el-input size="small" v-model="city" placeholder="请输入城市名称"
@blur="addCity(scope.$index)" @keyup.native="btKeyUp"
@keydown.native="btKeyDown" ></el-input> // methods内 // 只能输入汉字、英文、数字
btKeyDown(e) { e.target.value =
e.target.value.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5]/g,""); }, //限制输入特殊字符
btKeyUp(e) { e.target.value =
e.target.value.replace(/[`~!@#$%^&*()_\-+=<>?:"{}|,.\/;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”【】、;‘’,。、]/g,"");
}
在el-input  内  使用 keyup等事件  需要添加 .native    否则无法正常执行事件

下面是 只可输入数字
<el-input size="small" v-model="scope.row.order_number"
v-show="scope.row.isShowInp_order" @blur="editOrder(scope.$index,scope.row)"
v-focus @keyup.native="UpNumber" @keydown.native="UpNumber" class="table_input"
></el-input> // 只可输入数字 UpNumber(e) { e.target.value =
e.target.value.replace(/[^\d]/g,""); }
 

 

 

 

技术
今日推荐
PPT
阅读数 119
下载桌面版
GitHub
百度网盘(提取码:draw)
Gitee
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:ixiaoyang8@qq.com
QQ群:766591547
关注微信