Skip to content

Commit 366f468

Browse files
committed
fix(vue): pass router-link value to href to properly render clickable elements
1 parent bf60712 commit 366f468

File tree

1 file changed

+11
-0
lines changed
  • packages/vue/src/vue-component-lib

1 file changed

+11
-0
lines changed

packages/vue/src/vue-component-lib/utils.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,17 @@ export const defineContainer = <Props, VModelType = string | number | boolean>(
176176
}
177177
}
178178

179+
// If router link is defined, add href to props
180+
// in order to properly render an anchor tag inside
181+
// of components that should become activatable and
182+
// focusable with router link.
183+
if (props[ROUTER_LINK_VALUE] !== EMPTY_PROP) {
184+
propsToAdd = {
185+
...propsToAdd,
186+
href: props[ROUTER_LINK_VALUE],
187+
};
188+
}
189+
179190
/**
180191
* vModelDirective is only needed on components that support v-model.
181192
* As a result, we conditionally call withDirectives with v-model components.

0 commit comments

Comments
 (0)