owntone-server/web-src/src/components/IndexButtonList.vue

35 lines
773 B
Vue
Raw Normal View History

<template>
<section>
<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" />
</nav>
</section>
</template>
<script>
export default {
name: 'IndexButtonList',
props: ['index'],
computed: {
filtered_index() {
if (!this.index) {
return []
}
const specialChars = '!"#$%&\'()*+,-./:;<=>?@[\\]^`{|}~'
return this.index.filter((c) => !specialChars.includes(c))
}
},
methods: {
nav: function (id) {
2022-02-19 00:18:01 -05:00
this.$router.push({ hash: '#index_' + id })
},
scroll_to_top: function () {
window.scrollTo({ top: 0, behavior: 'smooth' })
}
}
}
</script>
<style></style>