字符串每4位 一个空格 <input placeholder="银行卡账号" v-model="num"/> watch: { ['num'](val) { this.$nextTick(() => { this.num= val.replace(/\s/g,'').replace(/....(?!$)/g,'$& '); }); } }