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/nouns.vue

67 lines
2.2 KiB
Vue
Raw Normal View History

2020-08-04 07:15:41 -07:00
<template>
2020-11-16 11:43:44 -08:00
<div>
2020-09-11 03:17:29 -07:00
<h2>
2020-08-04 07:15:41 -07:00
<Icon v="atom-alt"/>
2020-11-16 13:22:04 -08:00
<T>nouns.headerLonger</T>
2020-09-11 03:17:29 -07:00
</h2>
2020-08-04 07:15:41 -07:00
2020-11-16 13:22:04 -08:00
<NounsNav/>
2020-08-04 07:15:41 -07:00
<section>
<T>nouns.intro</T>
2020-08-04 07:15:41 -07:00
2020-10-12 02:46:26 -07:00
<Share :title="$t('nouns.headerLong')"/>
2020-08-04 07:15:41 -07:00
</section>
2020-10-16 03:57:03 -07:00
<NounsExtra>
2020-10-31 04:29:34 -07:00
<details v-if="config.nouns.collapsable" class="border mb-3" ref="dictionarywrapper">
<summary class="bg-light p-3" @click="$refs.collapsabledictionary.loadNouns()">
2020-10-16 03:57:03 -07:00
<h4 class="h5 d-inline">
<Icon v="book"/>
<T>nouns.dictionary</T>
</h4>
</summary>
<div class="border-top">
2020-10-31 04:29:34 -07:00
<Dictionary ref="collapsabledictionary"/>
2020-10-16 03:57:03 -07:00
</div>
</details>
2020-10-31 04:29:34 -07:00
<Dictionary v-else load ref="dictionary"/>
2020-10-16 03:57:03 -07:00
</NounsExtra>
2020-08-04 07:15:41 -07:00
</div>
</template>
<script>
2020-09-23 12:29:55 -07:00
import { head } from "../src/helpers";
2020-11-16 13:22:04 -08:00
import NounsNav from "../data/nouns/NounsNav.vue";
import NounsExtra from "../data/nouns/NounsExtra.vue";
2020-08-04 07:15:41 -07:00
export default {
2020-11-16 13:22:04 -08:00
components: { NounsNav, NounsExtra },
2020-08-05 03:04:31 -07:00
mounted() {
2020-12-07 10:10:14 -08:00
if (process.client && window.location.hash) {
const anchor = decodeURIComponent(window.location.hash.substr(1));
this.$nextTick(_ => {
const $anchor = document.getElementById(anchor);
if ($anchor) {
$anchor.scrollIntoView();
} else {
if (this.$refs.dictionarywrapper) {
this.$refs.dictionarywrapper.open = true;
this.$refs.collapsabledictionary.setFilter(anchor);
} else {
2020-12-07 10:10:14 -08:00
this.$refs.dictionary.setFilter(anchor);
}
2020-12-07 10:10:14 -08:00
}
});
2020-08-05 03:04:31 -07:00
}
},
2020-08-04 07:15:41 -07:00
head() {
2020-09-23 12:29:55 -07:00
return head({
2020-11-16 13:22:04 -08:00
title: this.$t('nouns.headerLonger'),
description: this.$t('nouns.description'),
2020-11-12 12:21:53 -08:00
banner: this.config.locale === 'pl' ? 'bannerNouns.png' : undefined,
2020-09-23 12:29:55 -07:00
});
2020-08-04 07:15:41 -07:00
},
}
</script>