feat: 搜索框支持in和like

This commit is contained in:
chenjinsong
2022-02-18 10:07:43 +08:00
parent ea383ee958
commit ca22b4e312
11 changed files with 380 additions and 50 deletions

View File

@@ -535,3 +535,21 @@ export function copyValue (item) {
export function getCurrentRoute () {
return router.currentRoute && router.currentRoute.path
}
// 判断数据相等
export function arrayIsEqual (arr1, arr2) {
if (arr1 === arr2) { // 如果2个数组对应的指针相同那么肯定相等同时也对比一下类型
return true
} else {
if (arr1.length !== arr2.length) {
return false
} else {
for (const i in arr1) { // 循环遍历对比每个位置的元素
if (arr1[i] !== arr2[i]) { // 只要出现一次不相等那么2个数组就不相等
return false
}
} // for循环完成没有出现不相等的情况那么2个数组相等
return true
}
}
}