You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

104 lines
2.4 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. <template>
  2. <div class="exhibitionList">
  3. <ul class="exhibition_dropdown tw-w-full">
  4. <li class="tw-mb-[27px]">
  5. <div :class="[
  6. 'tw-grid tw-grid-cols-[30px_224px] tw-items-center tw-gap-[10px] ',
  7. 'newdrawer_arrow',
  8. show ? 'show' : 'hide',
  9. ]" @click="showCategory(exhibitionIndex)">
  10. <img v-if="exhibitionListIcon !== undefined"
  11. :src="require(`@/assets/img/CategoryIcon/${exhibitionListIcon}.png`)" alt="" class="tw-mx-auto" />
  12. <div :class="[
  13. 'tw-head-body tw-text-neutrals-800',
  14. show == true ? 'tw-text-primary-1' : '',
  15. ]">
  16. {{ exhibitionCategory.CategoryName }}
  17. </div>
  18. </div>
  19. <template v-for="(title, index) in exhibitionCategory.SubCategoryList">
  20. <ul :class="['tw-pl-[40px] tw-mt-[16px]']" v-if="show"
  21. :key="index">
  22. <nuxt-link :to="localePath('/exhibition?subcategory=' + title.CategoryID)">
  23. <li class="tw-head-body tw-mb-[15px] tw-text-neutral-800">
  24. {{ title.CategoryName }}
  25. </li>
  26. </nuxt-link>
  27. </ul>
  28. </template>
  29. </li>
  30. </ul>
  31. </div>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {
  37. show: false,
  38. };
  39. },
  40. props: {
  41. exhibitionCategory: {
  42. type: Object,
  43. },
  44. exhibitionListIcon: {
  45. type: String,
  46. },
  47. exhibitionsActiveIndex: "",
  48. exhibitionIndex: "",
  49. },
  50. watch: {
  51. exhibitionsActiveIndex: {
  52. handler: function () {
  53. if (this.exhibitionsActiveIndex == true) {
  54. this.show = true;
  55. } else {
  56. this.show = false;
  57. }
  58. },
  59. },
  60. },
  61. methods: {
  62. showCategory(data) {
  63. this.activeIndex = data;
  64. this.$emit("activeIndex", this.activeIndex);
  65. this.show = !this.show;
  66. },
  67. },
  68. };
  69. </script>
  70. <style lang="scss" scoped>
  71. ul {
  72. list-style-type: none;
  73. padding: 0;
  74. }
  75. .newdrawer_arrow {
  76. position: relative;
  77. &::after {
  78. content: "";
  79. display: inline-block;
  80. position: absolute;
  81. right: 0;
  82. margin-top: auto;
  83. margin-bottom: auto;
  84. background-image: url("~/assets/svg/newdrawer_arrow.svg");
  85. background-size: 100%;
  86. background-position: right center;
  87. background-repeat: no-repeat;
  88. width: 10px;
  89. height: 6px;
  90. transition: all 0.2s linear;
  91. }
  92. &.show {
  93. &::after {
  94. background-image: url("~/assets/svg/newDrawer_uparrow.svg");
  95. }
  96. }
  97. }
  98. </style>