库存盘点
This commit is contained in:
1 parent
cdc44f8284
commit
89516f2da2
2 files changed
+57
-73
No files matched your search
@@ -1,17 +0,0 @@
|
||||
import { computed } from "vue"
|
||||
|
||||
const useComputed = (fn: Function) => {
|
||||
const map = new Map()
|
||||
|
||||
return (...args: any[]) => {
|
||||
const key = JSON.stringify(args)
|
||||
|
||||
if (map.has(key)) return map.get(key)
|
||||
|
||||
const comput = computed(() => fn(...args))
|
||||
map.set(key, comput)
|
||||
return comput
|
||||
}
|
||||
}
|
||||
|
||||
export default useComputed
|
||||
Reference in new issue
Block a user