feat: 增加無障礙標籤及ARIA屬性以改善可訪問性

This commit is contained in:
skytek_xinliang
2026-03-31 11:13:13 +08:00
parent 918da2f79e
commit 8dbae6c614
5 changed files with 40 additions and 12 deletions
@@ -9,6 +9,8 @@
<template #activator="{ props: activatorProps }">
<v-list-item
v-bind="isShrink ? undefined : activatorProps"
role="listitem"
:aria-selected="undefined"
:class="{ 'px-0': isShrink }"
:link="isNavigable(item) && !!item.path"
:to="isNavigable(item) ? item.path : undefined"
@@ -52,6 +54,8 @@
<template #activator="{ props: subProps }">
<v-list-item
v-bind="subProps"
role="listitem"
:aria-selected="undefined"
:link="isNavigable(subItem)"
:prepend-icon="subItem.icon || mdiMenuRight"
:to="isNavigable(subItem) ? subItem.path : undefined"
@@ -83,7 +87,7 @@
@click="emitSelect(subSubItem)"
>
<template #title>
<v-tooltip location="end" :text="subSubItem.title">
<v-tooltip location="end" :text="subSubItem.title" :aria-label="subSubItem.title">
<template #activator="{ props: tooltipProps }">
<span v-bind="tooltipProps" class="text-body-2 nav-text-overflow">{{
subSubItem.title
@@ -102,7 +106,7 @@
@click="emitSelect(subItem)"
>
<template #title>
<v-tooltip location="end" :text="subItem.title">
<v-tooltip location="end" :text="subItem.title" :aria-label="subItem.title">
<template #activator="{ props: tooltipProps }">
<span v-bind="tooltipProps" class="text-body-2 nav-text-overflow">{{
subItem.title
@@ -134,7 +138,7 @@
>
</template>
<template #title>
<v-tooltip v-if="!isShrink" location="end" :text="item.title">
<v-tooltip v-if="!isShrink" location="end" :text="item.title" :aria-label="item.title">
<template #activator="{ props: tooltipProps }">
<span v-bind="tooltipProps" class="text-body-2 nav-text-overflow">{{
item.title