123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
- <template>
- <div>
- <Article :news="newsItem" />
- </div>
- </template>
- <script>
- import { mapGetters } from "vuex";
- export default {
- data() {
- return {
- adsList: [],
- count: 0
- }
- },
- computed: {
- ...mapGetters({
- newsItem: "modules/news/newsItem",
- }),
- status() {
- if (!this.ads) {
- return false;
- } else {
- return true;
- }
- },
- },
- mounted() {},
- async fetch({ store, route, error }) {
- await store.dispatch("modules/news/setNewsItem", {
- category: 'articles',
- alias: route.params.alias
- });
- const newsItem = store.getters['modules/news/newsItem'];
- if(!newsItem){
- error({ statusCode: 404 })
- }
- },
- head() {
- return {
- title: this.newsItem.title,
- meta: [
- {
- name: "copyright",
- content: "ИА Амител",
- },
- {
- name: "publisher",
- content: "https://g.page/amitel?gm",
- },
- {
- name: "author",
- content: this.newsItem.show_author ? this.newsItem.author ? this.newsItem.author.name : 'ИА Амител' : "ИА Амител",
- },
- {
- name: "mediator_author",
- content: "ИА Амител",
- },
- {
- name: "description",
- content: this.newsItem.description
- },
- {
- name: "keys",
- content:
- this.newsItem.meta.key
- },
- {
- hid: 'twitter:title',
- name: 'twitter:title',
- content: this.newsItem.title
- },
- {
- hid: 'twitter:description',
- name: 'twitter:description',
- content: this.newsItem.description
- },
- // {
- // hid: 'twitter:image',
- // name: 'twitter:image',
- // content: this.newsItem.image.url
- // },
- {
- hid: 'twitter:image:alt',
- name: 'twitter:image:alt',
- content: this.newsItem.title
- },
- {
- hid: 'og:title',
- property: 'og:title',
- content: this.newsItem.title
- },
- {
- hid: 'og:description',
- property: 'og:description',
- content: this.newsItem.description
- },
- // {
- // hid: 'og:image',
- // property: 'og:image',
- // content: this.newsItem.image.url
- // },
- // {
- // hid: 'og:image:secure_url',
- // property: 'og:image:secure_url',
- // content: this.newsItem.image.url
- // },
- {
- hid: 'og:image:alt',
- property: 'og:image:alt',
- content: this.newsItem.title
- }
- ],
- link_id: [
- {rel: 'canonical', href: this.newsItem.category ? 'https://www.amic.ru/articles/' + this.newsItem.alias : ''}
- ],
- };
- },
- };
- </script>
- <style lang="less">
- .detail-top__header {
- margin-bottom: 0;
- }
- @media screen and (max-width: 900px) {
- .detail {
- &__wrapper {
- flex-direction: column-reverse;
- }
- &__side {
- margin-bottom: 20px;
- display: none;
- }
- }
- .detail-top {
- &__header {
- display: block;
- }
- &__footer {
- display: block;
- }
- &__footer-side {
- display: flex;
- margin-top: 20px;
- }
- }
- .detail-article-news__wrapper {
- display: block;
- }
- }
- .detail-article-news__side {
- display: flex;
- align-items: center;
- }
- </style>
|