You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
477 B
Vue

<template>
<ul>
<slot
v-for="page of []
.filter(page => page.regularPath.match(new RegExp(`^${ path }.`)))
.slice(0, limit)
"
:page="page"
>
<li>
<router-link :to="page.regularPath">{{ page.title }}</router-link>
</li>
</slot>
</ul>
</template>
<script>
export default {
name: "TableOfContents",
props: {
path: String,
limit: {
type: Number,
default: 8,
},
},
};
</script>