只能输入数字
<el-input
v-model="parseObj"
placeholder="请输入数字"
@keyup.native="parseObj=parseObj.replace(/[^\d]/g,'')"
maxlength="9"
>
</el-input>
输入框只能输入汉字
<el-input
v-model="parseObj"
placeholder="请输入汉字"
@keyup.native="parseObj=parseObj.replace(/[\u4E00-\u9FA5]/g,'')"
maxlength="9"
>
</el-input>
输入框输入除汉字以外的文字
<el-input
v-model="parseObj"
placeholder="请输入汉字"
@keyup.native="parseObj=parseObj.replace(/[\u4E00-\u9FA5]/g,'')"
maxlength="9"
>
</el-input>
输入框只能输入字母
<el-input
v-model="parseObj"
placeholder="请输入字母"
@keyup.native="parseObj=parseObj.replace(/[^A-Za-z0-9]/g,'')"
maxlength="9"
>
</el-input>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!