1acee2bf067f9a9ce1747be97615a39b52012ee6.svn-base 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <template>
  2. <div>
  3. <div class="TheOdds-title">{{data.title}}</div>
  4. <div class="TheOdds-list" v-for="(i,index) in data.list" :key="i.id">
  5. <div class="TheOdds-list-left">
  6. <span>{{i.name}}</span>
  7. </div>
  8. <div class="TheOdds-list-right">
  9. <div :class="i.istrue==true?'TheOdds-list-right-num active':'TheOdds-list-right-num'" @click="myisclick(index)">
  10. {{i.ratio}}
  11. </div>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. export default {
  18. name:"TheOdds",
  19. data() {
  20. return {
  21. data:{
  22. title:'冠军',
  23. list:[
  24. {
  25. name:"曼城",
  26. ratio:"3.25"
  27. },
  28. {
  29. name:"尤文图斯",
  30. ratio:"3.25"
  31. },
  32. {
  33. name:"巴塞罗那",
  34. ratio:"3.25"
  35. },
  36. {
  37. name:"利物浦",
  38. ratio:"3.25"
  39. }
  40. ]
  41. }
  42. }
  43. },
  44. methods: {
  45. myisclick(index){
  46. this.$set(this.data.list[index],'istrue',this.data.list[index].istrue==true?false:true)
  47. }
  48. },
  49. }
  50. </script>
  51. <style scoped>
  52. .TheOdds-title{
  53. height: .88rem;
  54. background: #e4e4e4;
  55. display: flex;
  56. padding:0 .32rem;
  57. align-items: center;
  58. font-size: .28rem;
  59. color: #333;
  60. }
  61. .TheOdds-list{
  62. height: .88rem;
  63. display: flex;
  64. justify-content: space-between;
  65. align-items: center;
  66. border-bottom: 1px solid #e4e4e4;
  67. padding: 0 .32rem;
  68. background: #fff;
  69. }
  70. .TheOdds-list-left,.TheOdds-list-right{
  71. width: 50%;
  72. height: 100%;
  73. }
  74. .TheOdds-list-left{
  75. font-size: .32rem;
  76. color: #333;
  77. display: flex;
  78. align-items: center;
  79. }
  80. .TheOdds-list-right{
  81. font-size: .26rem;
  82. color: #333;
  83. display: flex;
  84. justify-content: flex-end;
  85. align-items: center;
  86. }
  87. .TheOdds-list-right-num{
  88. width: 1.07rem;
  89. height: .76rem;
  90. border: 1px solid #e4e4e4;
  91. border-radius: .1rem;
  92. display: flex;
  93. justify-content: center;
  94. align-items: center;
  95. font-weight: bold;
  96. }
  97. .active{
  98. background: #e4e4e4;
  99. }
  100. </style>