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.

92 lines
2.2 KiB

2 years ago
  1. <template>
  2. <v-row class="mb-6">
  3. <v-col cols="12">
  4. <div
  5. ref="descripttextarea"
  6. :class="expand ? 'lineDescriptionClamp' : ''"
  7. v-html="exhibition.description"
  8. ></div>
  9. <p></p>
  10. <div class="tw-hidden lg:tw-block">
  11. <div
  12. v-if="hide"
  13. class="d-flex justify-center primary--text"
  14. @click="expand = !expand"
  15. >
  16. <a
  17. >{{ expand ? $t("See more") : $t("See less") }} &nbsp;&nbsp;<v-icon
  18. color="primary"
  19. >{{ expand ? "mdi-chevron-down" : "mdi-chevron-up" }}</v-icon
  20. ></a
  21. >
  22. </div>
  23. </div>
  24. <div class="lg:tw-hidden">
  25. <button
  26. v-if="hide"
  27. class="d-flex justify-center primary--text tw-w-full tw-body-3 tw-rounded-lg tw-text-primary-1 tw-border-solid tw-border-[1px] tw-border-primary-1 tw-py-[10px] tw-px-[130px] tw-whitespace-nowrap"
  28. @click="$modal.show('SeeMoreDetailDescripition')"
  29. >
  30. See more
  31. </button>
  32. </div>
  33. <SeeMoreDetailDescripition
  34. v-bind:SeeMoreDetailDescripition="exhibition.description"
  35. ></SeeMoreDetailDescripition>
  36. </v-col>
  37. </v-row>
  38. </template>
  39. <script>
  40. import VClamp from "vue-clamp";
  41. import SeeMoreDetailDescripition from "@/components/exhibition/SeeMoreDetailDescription.vue";
  42. export default {
  43. name: "ExhibitionDetailDescription",
  44. components: {
  45. VClamp,
  46. SeeMoreDetailDescripition,
  47. },
  48. props: {
  49. exhibition: {
  50. type: Object,
  51. default: () => ({
  52. description: "",
  53. }),
  54. SeeMoreDetailDescripition: {
  55. type: Object,
  56. },
  57. },
  58. },
  59. data() {
  60. return {
  61. expand: true,
  62. hide: false,
  63. };
  64. },
  65. mounted() {
  66. this.$refs.descripttextarea.scrollHeight > 240
  67. ? (this.hide = true)
  68. : (this.hide = false);
  69. },
  70. updated() {
  71. this.$refs.descripttextarea.scrollHeight > 240
  72. ? (this.hide = true)
  73. : (this.hide = false);
  74. },
  75. methods: {},
  76. };
  77. </script>
  78. <style lang="scss" scoped>
  79. .lineDescriptionClamp {
  80. display: -webkit-box;
  81. -webkit-box-orient: vertical;
  82. -webkit-line-clamp: 10;
  83. overflow: hidden;
  84. }
  85. a:hover {
  86. color: #ee9546;
  87. }
  88. </style>