kun 19/9/24 20:10

This commit is contained in:
沈学坤
2019-09-24 20:10:04 +08:00
parent 1474d83d39
commit ccabe846fb
8 changed files with 639 additions and 64 deletions

10
static/js/tool.js Normal file
View File

@@ -0,0 +1,10 @@
/** 筛选函数 */
export function multiFilter (array, filters) {
const filterKeys = Object.keys(filters)
return array.filter(item => {
return filterKeys.every(key => {
if (!filters[key].length) return true
return !!~filters[key].indexOf(item[key])
})
})
}