Use shortened model name in scene explorer

This commit is contained in:
andrewwallacespeckle 2024-05-14 12:04:44 +02:00
Родитель bb63350631
Коммит b86e1d8577
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -183,8 +183,17 @@ const isAtomic = computed(() => props.treeItem.atomic === true)
const speckleData = props.treeItem?.raw as SpeckleObject
const rawSpeckleData = props.treeItem?.raw as SpeckleObject
function getNestedModelHeader(name: string): string {
const parts = name.split('/')
return parts.length > 1 ? (parts.pop() as string) : name
}
const headerAndSubheader = computed(() => {
return getHeaderAndSubheaderForSpeckleObject(rawSpeckleData)
const { header, subheader } = getHeaderAndSubheaderForSpeckleObject(rawSpeckleData)
return {
header: getNestedModelHeader(header),
subheader
}
})
const childrenLength = computed(() => {