vue将数组里的重复去重

result:['1','2','3','1']


this.result = this.result.filter((item, index) => {
        return this.result.indexOf(item, 0) === index;
});
// console.log(this.result); 输出'1','2','3'

你可能感兴趣的:(vue,前端,javascript,html)