//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,'') } }) },
但是存在一個問題。只能輸入英文和數字,無法輸入符號之類的。