<el-form class="det_foot" :model="form" :rules="rules" ref="form">
<h3 class="det_lytitle">在线留言</h3>
<el-form-item class="det_form">
<el-input v-model="form.name" class="det_inp" onkeyup="form.name=form.name.replace(/[^\u4e00-\u9fa5]/g,‘‘)" placeholder="您的姓名"></el-input>
<el-input v-model="form.contact" maxlength="11" class="det_inp" placeholder="您的联系方式"></el-input>
</el-form-item>
</el-form>
主要代码部分:
onkeyup="form.name=form.name.replace(/[^\u4e00-\u9fa5]/g,‘‘)"