Updates for Steps and TabMenu demos
parent
c4d9c17a69
commit
00bc73113f
|
@ -2,7 +2,7 @@
|
||||||
<ul ref="nav" class="doc-section-nav">
|
<ul ref="nav" class="doc-section-nav">
|
||||||
<li v-for="doc of docs" :key="doc.label" :class="['navbar-item', { 'active-navbar-item': activeId === doc.id }]">
|
<li v-for="doc of docs" :key="doc.label" :class="['navbar-item', { 'active-navbar-item': activeId === doc.id }]">
|
||||||
<div class="navbar-item-content">
|
<div class="navbar-item-content">
|
||||||
<NuxtLink :to="`/${$router.currentRoute.value.name}/#${doc.id}`">
|
<NuxtLink :to="`${checkRouteName}/#${doc.id}`">
|
||||||
<button class="p-link" @click="onButtonClick(doc)">{{ doc.label }}</button>
|
<button class="p-link" @click="onButtonClick(doc)">{{ doc.label }}</button>
|
||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</div>
|
</div>
|
||||||
|
@ -11,7 +11,7 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="child of doc.children" :key="child.label" :class="['navbar-item', { 'active-navbar-item': activeId === child.id }]">
|
<li v-for="child of doc.children" :key="child.label" :class="['navbar-item', { 'active-navbar-item': activeId === child.id }]">
|
||||||
<div class="navbar-item-content">
|
<div class="navbar-item-content">
|
||||||
<NuxtLink :to="`/${$router.currentRoute.value.name}/#${child.id}`">
|
<NuxtLink :to="`${checkRouteName}/#${child.id}`">
|
||||||
<button class="p-link" @click="onButtonClick(child)">
|
<button class="p-link" @click="onButtonClick(child)">
|
||||||
{{ child.label }}
|
{{ child.label }}
|
||||||
</button>
|
</button>
|
||||||
|
@ -104,6 +104,17 @@ export default {
|
||||||
getIdOfTheSection(section) {
|
getIdOfTheSection(section) {
|
||||||
return section.querySelector('a').getAttribute('id');
|
return section.querySelector('a').getAttribute('id');
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
checkRouteName() {
|
||||||
|
const path = this.$router.currentRoute.value.path;
|
||||||
|
|
||||||
|
if (path.lastIndexOf('/') === path.length - 1) {
|
||||||
|
return path.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<component :is="$attrs.level === 2 ? 'h3' : 'h2'" class="doc-section-label">
|
<component :is="$attrs.level === 2 ? 'h3' : 'h2'" class="doc-section-label">
|
||||||
{{ $attrs.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>
|
</component>
|
||||||
<div v-if="$attrs" class="doc-section-description">
|
<div v-if="$attrs" class="doc-section-description">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
|
@ -22,6 +22,17 @@ export default {
|
||||||
parentElement.scrollIntoView({ block: 'start' });
|
parentElement.scrollIntoView({ block: 'start' });
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
checkRouteName() {
|
||||||
|
const path = this.$router.currentRoute.value.path;
|
||||||
|
|
||||||
|
if (path.lastIndexOf('/') === path.length - 1) {
|
||||||
|
return path.slice(0, -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue