1、处理input输入框输入或复制带有空格的字符。 //先给输入框绑定一个@input事件 <el-input v-model="ruleForm.label" placeholder="请输入显示名称" @input="handelBlank1"></el-input> // 使用正则替换到带有空格的字符 handelBlank1() { this.ruleForm.label = this.ruleForm.label.replace(/\s+/g, ""); },