problem.vue 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <div>
  3. <div class="bz-container">
  4. <div class="bz-title">
  5. <span>常见问题</span>
  6. </div>
  7. <div class="bz-titlebox">
  8. <div class="bz-worp">
  9. <div class="bz-box">
  10. <div class="bz-sskuang">
  11. <span><img class="bz-sousuoimg" src="/static/img/assets/sou.png" alt=""></span>
  12. <input class="bz-sousuo" type="text" placeholder="请输入标题搜索"/>
  13. </div>
  14. <button class="bz-btn">搜索</button>
  15. </div>
  16. <div class="bz-right-conent">
  17. <ul>
  18. <li v-for="(d , i) in arr" :key="i">
  19. <div class="over" @click="shows(d,i)" style="cursor: pointer">
  20. <span class="left bz-yuandian"></span>
  21. <span class="left">{{d.title}}</span>
  22. <img class="right bz-copy" :class="d.isshow ? 'rotates' : 'norotate'" src="/static/img/Triangle Copy 4.png" alt="">
  23. </div>
  24. <div ref="title" class="Text-content" :class="d.isshow ? 'dispays' : 'hides'">
  25. <p ref="text">{{d.centent}}</p>
  26. </div>
  27. </li>
  28. </ul>
  29. </div>
  30. </div>
  31. </div>
  32. </div>
  33. </div>
  34. </template>
  35. <script>
  36. export default {
  37. data(){
  38. return {
  39. arr:[
  40. {isshow: true, title:'方式不同吧好像是差不多',centent:'警方圣诞快乐JFK的实力积分积分累积角度考虑实际疯狂的世界佛教埃及空军看见反抗类毒素解放就'},
  41. {isshow: false, title:'XXXXXXXXXXXXXXX操作文档',centent:'警方圣诞快发顺丰到付乐JFK的实力积分积分累积角度狂的世界佛教埃及空军看见反抗类毒素解放就'},
  42. {isshow: false, title:'XXXXXXXXXXXXX操作文档',centent:'警方圣诞快分积分累积角度考虑实际疯狂的世界佛教埃及空军看见反抗类毒素解放就'},
  43. ]
  44. }
  45. },
  46. methods: {
  47. shows(d,i){
  48. d.isshow = !d.isshow
  49. let textH = this.$refs.text[i].offsetHeight;
  50. this.$refs.title[i].style.height = textH + 'px'
  51. }
  52. }
  53. }
  54. </script>
  55. <style scoped>
  56. .dispays {
  57. transition: All 0.4s ease-in-out;
  58. -webkit-transition: All 0.4s ease-in-out;
  59. -moz-transition: All 0.4s ease-in-out;
  60. -o-transition: All 0.4s ease-in-out;
  61. }
  62. .hides {
  63. height: 0 !important;
  64. margin-bottom: -13px;
  65. transition: All 0.4s ease-in-out;
  66. -webkit-transition: All 0.4s ease-in-out;
  67. -moz-transition: All 0.4s ease-in-out;
  68. -o-transition: All 0.4s ease-in-out;
  69. }
  70. .Text-content {
  71. float: left;
  72. width: 90%;
  73. margin-left: 4%;
  74. margin-top: 2%;
  75. }
  76. .rotates {
  77. transform: rotate(0deg);
  78. -webkit-transform: rotate(0deg);
  79. -moz-transform: rotate(0deg);
  80. -o-transform: rotate(0deg);
  81. -ms-transform: rotate(0deg);
  82. }
  83. .norotate {
  84. transform: rotate(-90deg);
  85. -webkit-transform: rotate(-90deg);
  86. -moz-transform: rotate(-90deg);
  87. -o-transform: rotate(-90deg);
  88. -ms-transform: rotate(-90deg);
  89. }
  90. .bz-container {
  91. width: 55%;
  92. margin: 0 auto;
  93. font-size: 14px;
  94. margin-top: 11%;
  95. margin-bottom: 190px;
  96. }
  97. .bz-titlebox {
  98. background: #FFFFFF;
  99. border: 1px solid rgba(30,136,245,0.32);
  100. box-shadow: 0 20px 60px 10px rgba(13,37,62,0.05);
  101. border-radius: 4px;
  102. }
  103. .bz-title {
  104. text-align: left;
  105. font-size: 14px;
  106. color: white;
  107. margin-bottom: 36px;
  108. }
  109. .bz-title span {
  110. background: #1E88F5;
  111. border-radius: 2px;
  112. padding: 6px 24px;
  113. }
  114. .bz-copy {
  115. margin-right: 7px;
  116. margin-top: 5px;
  117. transition: All 0.4s ease-in-out;
  118. -webkit-transition: All 0.4s ease-in-out;
  119. -moz-transition: All 0.4s ease-in-out;
  120. -o-transition: All 0.4s ease-in-out;
  121. }
  122. </style>