Menu.vue 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <aside class="catalog__side">
  3. <div class="catalog__menu">
  4. <div class="catalog-menu">
  5. <div class="catalog-menu__wrapper">
  6. <div class="catalog-menu__list">
  7. <nuxt-link
  8. :to="{
  9. name: 'news-category',
  10. params: { category: categoryLink.alias },
  11. }"
  12. class="catalog-menu__item catalog-menu__link"
  13. v-for="categoryLink in links"
  14. :key="categoryLink.alias"
  15. ><span>
  16. {{ categoryLink.name }}
  17. </span>
  18. </nuxt-link>
  19. </div>
  20. </div>
  21. </div>
  22. </div>
  23. <div class="catalog__side-banner">
  24. <BannersW240H400 />
  25. </div>
  26. </aside>
  27. </template>
  28. <script>
  29. import { mapGetters } from "vuex";
  30. export default {
  31. data() {
  32. return {
  33. menuList: [],
  34. script: ``,
  35. };
  36. },
  37. async asyncData({ store }) {
  38. await store.dispatch("setCategoriesList");
  39. },
  40. computed: {
  41. ...mapGetters({
  42. categoriesList: "modules/news/categoriesList",
  43. }),
  44. links() {
  45. let list = this.categoriesList.data.filter((link) => {
  46. return (
  47. link.alias !== "articles" &&
  48. link.alias !== "video" &&
  49. link.alias !== "slushay" &&
  50. link.alias !== "daily_news"
  51. );
  52. });
  53. return list;
  54. },
  55. },
  56. };
  57. </script>
  58. <style>
  59. </style>