This commit is contained in:
yinsx
2025-12-13 15:40:01 +08:00
commit 39c0f7e708
104 changed files with 6460 additions and 0 deletions

View File

@ -0,0 +1,28 @@
import { computed } from 'vue'
import type { BaseNodeProps, StandardNodeOptions } from './types'
export function useStandardNode<TData>(
props: BaseNodeProps<TData>,
options: StandardNodeOptions<TData>
) {
const bodyItems = computed(() => {
return options.body ? options.body(props) : []
})
const badge = computed(() => {
if (typeof options.badge === 'function') {
return options.badge(props)
}
return options.badge
})
const status = computed(() => options.status?.(props))
return {
props,
definition: options,
bodyItems,
badge,
status
}
}