feat(runtime-dom): allow native Set as v-model checkbox source (#1957)

This commit is contained in:
Pick
2020-09-14 23:16:50 +08:00
committed by GitHub
parent 542680e478
commit cf1b6c666f
4 changed files with 104 additions and 4 deletions

View File

@@ -51,3 +51,10 @@ export function looseEqual(a: any, b: any): boolean {
export function looseIndexOf(arr: any[], val: any): number {
return arr.findIndex(item => looseEqual(item, val))
}
export function looseHas(set: Set<any>, val: any): boolean {
for (let item of set) {
if (looseEqual(item, val)) return true
}
return false
}