This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Zaimki/routes/faq.vue

57 lines
1.5 KiB
Vue
Raw Normal View History

2020-10-10 09:31:31 -07:00
<template>
<div class="container">
<h2>
<Icon v="map-marker-question"/>
<T>faq.headerLong</T>
</h2>
<section>
<details v-for="question in Object.keys($t('faq.questions'))" class="border mb-3" :id="question" :ref="question.replace(/-/g, '_')">
2020-10-10 09:31:31 -07:00
<summary class="bg-light p-3"><T>faq.questions.{{question}}.question</T></summary>
<div class="p-3 border-top">
<T>faq.questions.{{question}}.answer</T>
</div>
</details>
</section>
2020-10-11 07:27:21 -07:00
<section>
<Share :title="$t('faq.headerLong')"/>
</section>
2020-10-10 09:31:31 -07:00
</div>
</template>
<script>
2020-10-10 10:28:01 -07:00
import { head } from "../src/helpers";
2020-10-10 09:31:31 -07:00
export default {
mounted() {
if (process.client && window.location.hash) {
const active = decodeURIComponent(window.location.hash.substr(1));
const $el = this.$refs[active.replace(/-/g, '_')];
2020-10-10 09:31:31 -07:00
if (!$el) {
return;
}
$el[0].open = true;
$el[0].focus();
$el[0].scrollIntoView();
setTimeout(_ => {
$el[0].scrollIntoView();
}, 1000);
}
},
2020-10-10 10:28:01 -07:00
head() {
return head({
title: this.$t('faq.headerLong'),
});
},
2020-10-10 09:31:31 -07:00
};
</script>
<style lang="scss" scoped>
details {
summary {
font-weight: bold;
}
}
</style>