原文地址:https://blog.csdn.net/ks8380/article/details/96478522
html
<el-form-item label="输入密码:" prop="pass" required> <el-input type="password" @keyup.native="btKeyUp" v-model="ruleForm.pass" placeholder="请输入密码" autocomplete="new-password" ></el-input> </el-form-item>
data
data(){ return { ruleForm:{ pass:'' } } }
methods
btKeyUp(e) { e.target.value = e.target.value.replace(/[`~!@#$%^&*()_-+=<>?:"{}|,./;'\[]·~!@#¥%……&*()——-+={}|《》?:“”【】、;‘’,。、]/g,""); },