Ajuste Layout, Dashboard Terapeuta, Timeline, Suporte técnico, Documentação e FAQ
This commit is contained in:
@@ -27,11 +27,20 @@ function isLocked (item) {
|
||||
try { return !entitlements.has(item.feature) } catch { return false }
|
||||
}
|
||||
|
||||
function toPath (to) {
|
||||
if (!to) return ''
|
||||
if (typeof to === 'string') return to
|
||||
try { return router.resolve(to).path || '' } catch { return '' }
|
||||
}
|
||||
|
||||
function isActive (item) {
|
||||
const active = String(layoutState.activePath || route.path || '')
|
||||
if (!item.to) return false
|
||||
const p = typeof item.to === 'string' ? item.to : ''
|
||||
return active === p || active.startsWith(p + '/')
|
||||
const p = toPath(item.to)
|
||||
if (!p) return false
|
||||
if (active === p) return true
|
||||
const segments = p.split('/').filter(Boolean)
|
||||
return segments.length >= 2 && active.startsWith(p + '/')
|
||||
}
|
||||
|
||||
function navigate (item) {
|
||||
|
||||
Reference in New Issue
Block a user