mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
fix(Link): handle aria-current like NuxtLink / RouterLink
This commit is contained in:
@@ -102,6 +102,7 @@ defineOptions({ inheritAttrs: false })
|
||||
const props = withDefaults(defineProps<LinkProps>(), {
|
||||
as: 'button',
|
||||
type: 'button',
|
||||
ariaCurrentValue: 'page',
|
||||
active: undefined,
|
||||
activeClass: '',
|
||||
inactiveClass: ''
|
||||
@@ -178,6 +179,7 @@ function resolveLinkClass({ route, isActive, isExactActive }: any) {
|
||||
<slot
|
||||
v-bind="{
|
||||
...$attrs,
|
||||
...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
|
||||
as,
|
||||
type,
|
||||
disabled,
|
||||
@@ -194,6 +196,7 @@ function resolveLinkClass({ route, isActive, isExactActive }: any) {
|
||||
v-else
|
||||
v-bind="{
|
||||
...$attrs,
|
||||
...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
|
||||
as,
|
||||
type,
|
||||
disabled,
|
||||
|
||||
@@ -103,6 +103,7 @@ defineOptions({ inheritAttrs: false })
|
||||
const props = withDefaults(defineProps<LinkProps>(), {
|
||||
as: 'button',
|
||||
type: 'button',
|
||||
ariaCurrentValue: 'page',
|
||||
active: undefined,
|
||||
activeClass: '',
|
||||
inactiveClass: ''
|
||||
@@ -204,6 +205,7 @@ function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
||||
<slot
|
||||
v-bind="{
|
||||
...$attrs,
|
||||
...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
|
||||
as,
|
||||
type,
|
||||
disabled,
|
||||
@@ -217,6 +219,7 @@ function resolveLinkClass({ route, isActive, isExactActive }: any = {}) {
|
||||
v-else
|
||||
v-bind="{
|
||||
...$attrs,
|
||||
...(exact && isExactActive ? { 'aria-current': props.ariaCurrentValue } : {}),
|
||||
as,
|
||||
type,
|
||||
disabled,
|
||||
|
||||
Reference in New Issue
Block a user