MiForChange.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <div>
  3. <div id="MiForChange">
  4. <ul>
  5. <li v-for="item,index in hightLightSomeOne" :class="{'highlight' : item.status}">
  6. <span @click="showMi(item,index)">{{ item.name }}</span>
  7. </li>
  8. </ul>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. export default {
  14. name: 'MiForChange'
  15. }
  16. </script>
  17. <script setup>
  18. import 'element-plus/es/components/date-picker/style/css'
  19. import {
  20. ueCallChangeMi
  21. } from '@/utils/UIInteractions'
  22. import {reactive} from "vue";
  23. const hightLightSomeOne = reactive([
  24. // { name: '50m', status: false },
  25. { name: '100m', status: false }
  26. ])
  27. // eslint-disable-next-line no-unused-vars
  28. function showMi(mi,index){
  29. hightLightSomeOne[index].status= !hightLightSomeOne[index].status
  30. hightLightSomeOne.forEach((item,indexs)=>{
  31. if (index!=indexs) {
  32. item.status = false
  33. }
  34. })
  35. ueCallChangeMi(mi.name)
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. #MiForChange {
  40. position: absolute;
  41. height: 40px;
  42. bottom: -37px;
  43. left: 63%;
  44. transform: translateX(-50%);
  45. display: flex;
  46. align-items: center;
  47. ul li{
  48. ransform: translateX(-50%);
  49. list-style: none;
  50. float: left;
  51. margin-right: 10px;
  52. font-size: 18px;
  53. font-weight: bold;}
  54. ul .highlight{
  55. span {
  56. color: #f0d60d;
  57. }
  58. }
  59. }
  60. </style>