diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-09 21:09:18 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-09 21:09:18 +0000 |
commit | ab5672c13d7fe5c79fdeac10e7505187cf4ba606 (patch) | |
tree | eb7036d6e4c8ce64c58f18185eced3a5e315c099 /app/assets/javascripts/super_sidebar/components/nav_item_router_link.vue | |
parent | d23f33082ad893fad172b17f1ce66bd847671d56 (diff) | |
download | gitlab-ce-ab5672c13d7fe5c79fdeac10e7505187cf4ba606.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/super_sidebar/components/nav_item_router_link.vue')
-rw-r--r-- | app/assets/javascripts/super_sidebar/components/nav_item_router_link.vue | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/app/assets/javascripts/super_sidebar/components/nav_item_router_link.vue b/app/assets/javascripts/super_sidebar/components/nav_item_router_link.vue new file mode 100644 index 00000000000..78aca24d9a6 --- /dev/null +++ b/app/assets/javascripts/super_sidebar/components/nav_item_router_link.vue @@ -0,0 +1,37 @@ +<script> +import { NAV_ITEM_LINK_ACTIVE_CLASS } from '../constants'; +import { ariaCurrent } from '../utils'; + +export default { + NAV_ITEM_LINK_ACTIVE_CLASS, + props: { + item: { + type: Object, + required: true, + }, + }, + computed: { + linkProps() { + return { + to: this.item.to, + }; + }, + }, + methods: { + ariaCurrent, + }, +}; +</script> + +<template> + <router-link + #default="{ href, navigate, isActive }" + v-bind="linkProps" + :active-class="$options.NAV_ITEM_LINK_ACTIVE_CLASS" + custom + > + <a :href="href" :aria-current="ariaCurrent(isActive)" @click="navigate"> + <slot :is-active="isActive"></slot> + </a> + </router-link> +</template> |