diff --git a/template/app/components/TreeNode.vue b/template/app/components/TreeNode.vue index d30315a..7ba119f 100644 --- a/template/app/components/TreeNode.vue +++ b/template/app/components/TreeNode.vue @@ -4,8 +4,13 @@ import { useTreeState } from '~/composables/useTreeState' defineProps({ nodes: Array, depth: { type: Number, default: 0 } }) const router = useRouter() +const route = useRoute() const { collapsed } = useTreeState() +function isActive(path) { + return !!path && route.path === path +} + function getTitle(node) { if (node.title === 'index') return 'Index' return node.title || node._path?.split('/').pop() || 'Home' @@ -51,7 +56,12 @@ function visibleChildren(node) {