select.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="select">
  3. <div class="region" @click="regions(0)">
  4. 地区
  5. <img src="../static/img/open.png" v-if="!region[0]" alt>
  6. <img src="../static/img/hide.png" v-else alt>
  7. </div>
  8. <div class="region" @click="regions(1)">
  9. 类别
  10. <img src="../static/img/open.png" v-if="!region[1]" alt>
  11. <img src="../static/img/hide.png" v-else alt>
  12. </div>
  13. <div id="region" v-if="region[0]">
  14. <ul class="left">
  15. <li>全国</li>
  16. <li>华北</li>
  17. <li>华北</li>
  18. <li>华北</li>
  19. <li>华北</li>
  20. <li>华北</li>
  21. <li>东北</li>
  22. </ul>
  23. <ul class="right">
  24. <li>全部</li>
  25. <li>辽宁省</li>
  26. <li>辽宁省</li>
  27. <li>辽宁省</li>
  28. <li>辽宁省</li>
  29. <li>辽宁省</li>
  30. <li>辽宁省</li>
  31. <li>辽宁省</li>
  32. </ul>
  33. </div>
  34. <ul id="category" v-if="region[1]">
  35. <li>535656</li>
  36. <li>535656</li>
  37. <li>535656</li>
  38. <li>535656</li>
  39. <li>535656</li>
  40. </ul>
  41. <div class="bg" v-if="region[0]||region[1]"></div>
  42. </div>
  43. </template>
  44. <script>
  45. import '~/assets/select.scss'
  46. export default {
  47. data() {
  48. return {
  49. region: [false, false],
  50. img: ['open', 'hide']
  51. }
  52. },
  53. created: function() {},
  54. methods: {
  55. regions(e) {
  56. const region = [false, false]
  57. region[e] = true
  58. const img = ['open', 'hide']
  59. img[e] = 'hide'
  60. this.img = img
  61. this.region = region
  62. }
  63. }
  64. }
  65. </script>