Save tree state
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { useTreeState } from '~/composables/useTreeState'
|
||||
|
||||
defineProps({ nodes: Array, depth: { type: Number, default: 0 } })
|
||||
|
||||
const router = useRouter()
|
||||
const collapsed = ref({})
|
||||
const { collapsed } = useTreeState() // ← shared state, not local ref
|
||||
|
||||
function getTitle(node) {
|
||||
if (node.title == "index") return "Index"
|
||||
return node.title || node._path?.split('/').pop() || 'Home';
|
||||
if (node.title === 'index') return 'Index'
|
||||
return node.title || node._path?.split('/').pop() || 'Home'
|
||||
}
|
||||
|
||||
function navigate(path) {
|
||||
|
||||
Reference in New Issue
Block a user