Updates for Steps and TabMenu demos

This commit is contained in:
Tuğçe Küçükoğlu 2023-03-02 17:47:18 +03:00
parent c4d9c17a69
commit 00bc73113f
2 changed files with 25 additions and 3 deletions

View file

@ -1,7 +1,7 @@
<template>
<component :is="$attrs.level === 2 ? 'h3' : 'h2'" class="doc-section-label">
{{ $attrs.label }}
<NuxtLink :id="$attrs.id" :to="`/${$router.currentRoute.value.name}/#${$attrs.id}`" target="_self" @click="onClick"> # </NuxtLink>
<NuxtLink :id="$attrs.id" :to="`${checkRouteName}/#${$attrs.id}`" target="_self" @click="onClick"> # </NuxtLink>
</component>
<div v-if="$attrs" class="doc-section-description">
<slot></slot>
@ -22,6 +22,17 @@ export default {
parentElement.scrollIntoView({ block: 'start' });
}, 0);
}
},
computed: {
checkRouteName() {
const path = this.$router.currentRoute.value.path;
if (path.lastIndexOf('/') === path.length - 1) {
return path.slice(0, -1);
}
return path;
}
}
};
</script>