index.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <template>
  2. <!-- 底部导航栏 -->
  3. <div class="footet-bottom">
  4. <div class="leftline"></div>
  5. <div class="rightline"></div>
  6. <ul v-show="btnlistshow">
  7. <li class="fontcolor " v-for="(item, index) in listArray" :key="index" :class="{btnactive: index === currentIndex}" @click="changeColor(index)"> <el-image :src="item.img" fit="contain"></el-image>{{item.name}}</li>
  8. <!-- <li class="fontcolor btnactive" > <el-image :src="bt1" fit="contain"></el-image>灾情推演</li>
  9. <li class="fontcolor"> <el-image :src="bt2" fit="contain"></el-image>路径判断</li>
  10. <li class="fontcolor"> <el-image :src="bt3" fit="contain"></el-image>灾害对比</li> -->
  11. </ul>
  12. </div>
  13. </template>
  14. <script setup>
  15. import { ref, onMounted, reactive, } from "vue";
  16. import {RouterView,RouterLink } from "vue-router"
  17. import { request, uploadFile } from "@/utils/request";
  18. import { ElMessage, ElButton, ElDialog, ElSelect } from 'element-plus'
  19. import bt1 from "@/assets/img/bt1.png"
  20. import bt2 from "@/assets/img/bt2.png"
  21. import bt3 from "@/assets/img/bt2.png"
  22. let btnindex=ref(0);
  23. let emit = defineEmits(['indexchange','hiadden' ])
  24. let listArray = ref([
  25. { id: 0, name: "灾情推演",img:bt1 },
  26. { id: 1, name: "路径判断" ,img:bt2},
  27. { id: 2, name: "灾害对比" ,img:bt2},
  28. ]);
  29. let currentIndex=ref(0);
  30. let btnlistshow=ref(false);
  31. const changeColor=(index)=>{
  32. btnindex.value=index;
  33. currentIndex.value = btnindex.value;
  34. emit("indexchange", btnindex.value);
  35. if(btnindex.value==0){
  36. emit("hiadden", 1);
  37. }else{
  38. emit("hiadden", 5);
  39. }
  40. }
  41. const showhadend=()=>{
  42. btnlistshow.value=true;
  43. }
  44. defineExpose({showhadend,changeColor,btnindex});
  45. </script>
  46. <style lang="scss" scoped>
  47. </style>