mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
fix(Link): properly pick all aria-* & data-* attrs
Resolves https://github.com/nuxt/ui-pro/issues/494, resolves #3007
This commit is contained in:
@@ -127,9 +127,11 @@ export const getNuxtLinkProps = (props) => {
|
||||
}
|
||||
|
||||
export const getULinkProps = (props) => {
|
||||
const keys = [...Object.keys(nuxtLinkProps), ...Object.keys(uLinkProps), 'ariaLabel', 'title']
|
||||
const keys = Object.keys(props)
|
||||
const ariaKeys = keys.filter(key => key.startsWith('aria-'))
|
||||
const dataKeys = keys.filter(key => key.startsWith('data-'))
|
||||
|
||||
return keys.reduce((acc, key) => {
|
||||
return [...Object.keys(nuxtLinkProps), ...Object.keys(uLinkProps), ...ariaKeys, ...dataKeys].reduce((acc, key) => {
|
||||
if (props[key] !== undefined) {
|
||||
acc[key] = props[key]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user