vue 将selectionRows数组赋值给thismustMiddlegroundDifArr数组并且保证thismustMiddlegroundDifArr不能重复赋值
您可以使用Set数据结构来实现将selectionRows数组赋值给this.mustMiddlegroundDifArr数组,并确保this.mustMiddlegroundDifArr不重复赋值的需求。
首先,将selectionRows数组转换为Set数据结构,以去除重复元素。然后,将Set转换为数组,并赋值给this.mustMiddlegroundDifArr数组。
以下是具体的代码示例:
this.mustMiddlegroundDifArr = Array.from(new Set(selectionRows));
这样,就可以将selectionRows数组赋值给this.mustMiddlegroundDifArr数组,并且保证this.mustMiddlegroundDifArr不重复赋值。
原文地址: https://www.cveoy.top/t/topic/iE1G 著作权归作者所有。请勿转载和采集!