2018-12-08 02:48:15 -05:00
|
|
|
<template>
|
2018-12-20 00:32:53 -05:00
|
|
|
<section>
|
2022-02-19 00:39:14 -05:00
|
|
|
<nav class="buttons is-centered fd-is-square" style="margin-bottom: 16px">
|
2022-05-20 07:44:22 -04:00
|
|
|
<a v-for="char in filtered_index" :key="char" class="button is-small" @click="nav(char)" v-text="char" />
|
2018-12-20 00:32:53 -05:00
|
|
|
</nav>
|
|
|
|
</section>
|
2018-12-08 02:48:15 -05:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
name: 'IndexButtonList',
|
|
|
|
props: ['index'],
|
|
|
|
computed: {
|
2022-02-19 00:39:14 -05:00
|
|
|
filtered_index() {
|
2022-02-19 01:47:54 -05:00
|
|
|
if (!this.index) {
|
|
|
|
return []
|
|
|
|
}
|
2018-12-08 02:48:15 -05:00
|
|
|
const specialChars = '!"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~'
|
2022-02-19 00:39:14 -05:00
|
|
|
return this.index.filter((c) => !specialChars.includes(c))
|
2018-12-08 02:48:15 -05:00
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
nav: function (id) {
|
2022-02-19 00:18:01 -05:00
|
|
|
this.$router.push({ hash: '#index_' + id })
|
2018-12-20 00:32:53 -05:00
|
|
|
},
|
|
|
|
|
|
|
|
scroll_to_top: function () {
|
|
|
|
window.scrollTo({ top: 0, behavior: 'smooth' })
|
2018-12-08 02:48:15 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
2022-02-19 00:39:14 -05:00
|
|
|
<style></style>
|