lbry.tech/.vuepress/components/Sidebar.vue
2018-05-07 12:01:37 +03:00

42 lines
554 B
Vue
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div id="sidebar">
<h2>{{ this.$page.title }}</h2>
<a v-for="link in this.$page.headers" v-bind:key="link.title" @click="goTo(link.slug)" v-bind:class="['level-' + link.level]">{{ link.title }}</a>
</div>
</template>
<script>
export default {
data () {
return {}
},
methods: {
goTo: function(slug) {
this.$router.push("#" + slug);
}
}
}
</script>
<style>
.level-3 {
padding-left: 1.5rem;
}
.level-4 {
padding-left: 3rem;
}
.level-5 {
padding-left: 4.5rem;
}
</style>