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