index.vue 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <template>
  2. <view>
  3. <view class="jiazheng-uni-list">
  4. <view>
  5. <view @click="clickAlltype">
  6. 全部类型
  7. </view>
  8. <view v-if="isOpen" v-for="(item,index) in allType" :key="index" @click="onSelectCell(item,index)">
  9. <view class="le-dropdown-cell-active-text">{{item.label}}</view>
  10. <view v-show="item.value==typeChecked" class=""></view>
  11. </view>
  12. <view>
  13. 更新时间
  14. </view>
  15. <view>
  16. 录入时间
  17. </view>
  18. <view>
  19. <view @click="toggle('top')">搜索</view>
  20. </view>
  21. </view>
  22. <view>
  23. <!-- 普通弹窗 -->
  24. <uni-popup ref="popup" background-color="#fff">
  25. <view>
  26. asdfdsfadsf阿萨德发生的发的顺丰
  27. </view>
  28. </uni-popup>
  29. </view>
  30. </view>
  31. </view>
  32. </template>
  33. <script setup>
  34. import {
  35. ref
  36. } from "vue";
  37. // import {
  38. // DropdownList
  39. // } from "./data.js";
  40. // const menuList = ref(DropdownList)
  41. const allType = [{
  42. label: "由近到远",
  43. value: 0
  44. },
  45. {
  46. label: "由远到近",
  47. value: 1
  48. },
  49. {
  50. label: "由远到近",
  51. value: 2
  52. },
  53. {
  54. label: "由远到近",
  55. value: 3
  56. },
  57. ]
  58. let isOpen = ref(false)
  59. let typeChecked = ref(1)
  60. const popup = ref(null);
  61. const clickAlltype = (data) => {
  62. isOpen.value = true
  63. }
  64. const onSelectCell = (data, index) => {
  65. console.log('data', data);
  66. console.log('index', index);
  67. isOpen.value = false
  68. }
  69. const toggle = (data, index) => {
  70. popup.value.open('top')
  71. }
  72. </script>
  73. <style>
  74. .jiazheng-uni-list {
  75. display: flex;
  76. width: 100%;
  77. flex-direction: column;
  78. }
  79. .jiazheng-uni-list-left {
  80. position: relative;
  81. display: flex;
  82. flex-direction: row;
  83. justify-content: space-between;
  84. align-items: center;
  85. }
  86. </style>