Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Fedex
/
imac-vue
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
Elements-SY
2023-09-21 18:12:10 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1e35f2f8a9e39f76115911c86a38d61e44952940
1e35f2f8
1 parent
08e38ca3
modify
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
src/utils/index.js
src/utils/index.js
View file @
1e35f2f
...
...
@@ -524,11 +524,11 @@ export function removeDuplicates(arr, keys) {
* filterRepeat(arr, "name")
*/
export
function
filterRepeat
(
arr
,
key
)
{
const
duplicateIds
=
arr
const
newArr
=
arr
.
map
((
item
)
=>
item
[
key
])
.
filter
((
key
,
index
,
array
)
=>
array
.
indexOf
(
key
)
!==
index
);
return
arr
.
filter
((
item
)
=>
duplicateIds
.
includes
(
item
[
key
]));
return
arr
.
filter
((
item
)
=>
newArr
.
includes
(
item
[
key
]));
}
/**
* Array Json
...
...
Please
register
or
login
to post a comment