2025/2/8第一次更新

This commit is contained in:
爱吃咸鱼小猫咪
2025-02-08 18:50:38 +08:00
commit d7af560866
26519 changed files with 5046029 additions and 0 deletions
@@ -0,0 +1,23 @@
import { shallowRef } from 'vue'
export const useOrderedChildren = <T extends { uid: number }>() => {
const children: Record<number, T> = {}
const orderedChildren = shallowRef<T[]>([])
const addChild = (child: T) => {
children[child.uid] = child
orderedChildren.value.push(child)
}
const removeChild = (uid: number) => {
delete children[uid]
orderedChildren.value = orderedChildren.value.filter(
(child) => child.uid !== uid
)
}
return {
children: orderedChildren,
addChild,
removeChild,
}
}