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

66 lines
2.1 KiB
Vue
Raw Normal View History

2020-08-04 07:15:41 -07:00
<template>
<div class="container">
2020-09-11 03:17:29 -07:00
<h2>
2020-08-04 07:15:41 -07:00
<Icon v="atom-alt"/>
<T>nouns.headerLong</T>
2020-09-11 03:17:29 -07:00
</h2>
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";
import NounsExtra from "../data/nouns/NounsExtra.vue";
2020-08-04 07:15:41 -07:00
export default {
components: { NounsExtra },
2020-08-05 03:04:31 -07:00
mounted() {
2020-10-09 15:13:00 -07:00
if (process.client) {
if (window.location.hash) {
const anchor = decodeURIComponent(window.location.hash.substr(1));
this.$nextTick(_ => {
const $anchor = document.getElementById(anchor);
if ($anchor) {
$anchor.scrollIntoView();
} else {
2020-10-31 04:29:34 -07:00
if (this.$refs.dictionarywrapper) {
this.$refs.dictionarywrapper.open = true;
this.$refs.collapsabledictionary.setFilter(anchor);
} else {
this.$refs.dictionary.setFilter(anchor);
}
}
})
2020-10-09 15:13:00 -07: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({
title: this.$t('nouns.headerLong'),
description: this.$t('nouns.description'),
2020-09-23 12:29:55 -07:00
banner: 'bannerNouns.png',
});
2020-08-04 07:15:41 -07:00
},
}
</script>