ParameterIndex.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <template>
  2. <div class="parameter_index">
  3. <div class="parameter_tag">
  4. <div
  5. class="tag"
  6. v-for="(tag, index) in tagslist" :key="index"
  7. :class="{selected: '/parameterIndex/' + tag.path === childRouter}"
  8. >
  9. <router-link :to="'/parameterIndex/' + tag.path" tag="li" class="title">{{tag.title}}</router-link>
  10. </div>
  11. </div>
  12. <div class="parameter_table">
  13. <router-view/>
  14. </div>
  15. </div>
  16. </template>
  17. <script>
  18. import { TAG } from '../../tableConfig/parameter';
  19. // import CarSeries from './CarSeries';
  20. export default {
  21. components:{
  22. // CarSeries
  23. },
  24. data() {
  25. return {
  26. tagslist: TAG
  27. }
  28. },
  29. computed: {
  30. childRouter: function() {
  31. return this.$route.path
  32. }
  33. },
  34. methods: {
  35. },
  36. mounted() {
  37. }
  38. }
  39. </script>
  40. <style scoped lang="less">
  41. .parameter_index{
  42. .parameter_tag{
  43. display: flex;
  44. justify-content: space-around;
  45. border: 1px solid #ccc;
  46. padding: 10px;
  47. .tag{
  48. width: 90px;
  49. height: 30px;
  50. background-color: #848484;
  51. line-height: 30px;
  52. text-align: center;
  53. border-radius: 5px;
  54. &:hover{
  55. cursor: pointer;
  56. }
  57. li{
  58. color: #fff;
  59. }
  60. }
  61. .selected{
  62. background-color: #0056A0;
  63. }
  64. }
  65. }
  66. </style>