fix: correct $route naming and aria-expanded type in DashboardLayout
- Rename \$route → route (no \$ prefix in script setup, that's Options API) - Use string 'true'/'false' for aria-expanded (ARIA spec requires string) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,7 +19,7 @@
|
|||||||
<button
|
<button
|
||||||
@click="dropdownOpen = !dropdownOpen"
|
@click="dropdownOpen = !dropdownOpen"
|
||||||
class="w-9 h-9 rounded-full bg-[#bb5b3e] flex items-center justify-center text-white text-sm font-black hover:bg-[#a34a31] transition-colors"
|
class="w-9 h-9 rounded-full bg-[#bb5b3e] flex items-center justify-center text-white text-sm font-black hover:bg-[#a34a31] transition-colors"
|
||||||
:aria-expanded="dropdownOpen"
|
:aria-expanded="dropdownOpen ? 'true' : 'false'"
|
||||||
aria-haspopup="true"
|
aria-haspopup="true"
|
||||||
>
|
>
|
||||||
{{ userInitials }}
|
{{ userInitials }}
|
||||||
@@ -97,7 +97,7 @@ import { RouterLink, RouterView, useRoute, useRouter } from 'vue-router'
|
|||||||
import { useAuth } from '../../composables/useAuth.js'
|
import { useAuth } from '../../composables/useAuth.js'
|
||||||
|
|
||||||
const { user, logout } = useAuth()
|
const { user, logout } = useAuth()
|
||||||
const $route = useRoute()
|
const route = useRoute()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
|
|
||||||
const dropdownOpen = ref(false)
|
const dropdownOpen = ref(false)
|
||||||
@@ -137,9 +137,9 @@ async function handleLogout() {
|
|||||||
|
|
||||||
function isActive(to) {
|
function isActive(to) {
|
||||||
if (to === '/dashboard') {
|
if (to === '/dashboard') {
|
||||||
return $route.path === '/dashboard'
|
return route.path === '/dashboard'
|
||||||
}
|
}
|
||||||
return $route.path.startsWith(to)
|
return route.path.startsWith(to)
|
||||||
}
|
}
|
||||||
|
|
||||||
const navItems = [
|
const navItems = [
|
||||||
|
|||||||
Reference in New Issue
Block a user