Vue Element项目如何实现输入框过滤特殊字符的技巧总结?
- 内容介绍
- 文章标签
- 相关推荐
本文共计607个文字,预计阅读时间需要3分钟。
javascript在main.js中添加方法:Vue.prototype.validSe=function(value, number=255) { value=value.replace(/[`~!@#$%^&*()_+?:{},.\/;'\[\]]/, '');};
可以在main.js中写入方法
Vue.prototype.validSe = function (value, number = 255) { value = value.replace(/[`~*~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”、;‘',。
本文共计607个文字,预计阅读时间需要3分钟。
javascript在main.js中添加方法:Vue.prototype.validSe=function(value, number=255) { value=value.replace(/[`~!@#$%^&*()_+?:{},.\/;'\[\]]/, '');};
可以在main.js中写入方法
Vue.prototype.validSe = function (value, number = 255) { value = value.replace(/[`~*~!@#$%^&*()_\-+=<>?:"{}|,./;'\\[\]·~!@#¥%……&*()——\-+={}|《》?:“”、;‘',。

