//html
<el-input v-model="form.name" auto-complete="off" style="width: 336px" @input.native="changeCode"></el-input> //method changeCode() { this.$nextTick(() => { if(this.form.name !== null){ this.form.name = this.form.name.replace(/[^\w\.\/]/ig,'') } }) },
但是存在一个问题。只能输入英文和数字,无法输入符号之类的。