In vue-cli, how to deduplicate the parameters in json data by using the methods of v-for loop and filter Filter?

json

Mar.18,2021

Computing properties are the best, of course, the list you pull back can be deduplicated directly.

rmSome = function(arr, key) {
 let tempObj = {}
 arr.forEach(item => {
     if (tempObj[item[key]]) {
         return
     } else {
         tempObj[item[key]] = item;
     }
 })
 return Object.values(tempObj)
}
rmSome([{a:1},{a:2},{a:2}],'a')
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3a749-2c22b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3a749-2c22b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?