平安校园
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

67 lines
1.1 KiB

  1. <template>
  2. <view>
  3. <view class="table">
  4. <uni-table border stripe emptyText="暂无更多数据">
  5. <!-- 表头行 -->
  6. <uni-tr>
  7. <uni-th align="left">时间</uni-th>
  8. <uni-th align="left">人数</uni-th>
  9. </uni-tr>
  10. <!-- 表格数据行 -->
  11. <uni-tr v-for="(item,index) in list" :key="index">
  12. <uni-td>{{item.time}}</uni-td>
  13. <uni-td>{{item.nums}}</uni-td>
  14. </uni-tr>
  15. </uni-table>
  16. </view>
  17. </view>
  18. </template>
  19. <script>
  20. import {
  21. dateFormat
  22. } from '../../../utils/date'
  23. export default {
  24. data() {
  25. return {
  26. list: [],
  27. }
  28. },
  29. mounted() {
  30. const {
  31. extJson
  32. } = this.options
  33. if (extJson) {
  34. this.list = JSON.parse(extJson).map(e => {
  35. e.time = dateFormat(new Date(e.time))
  36. return e
  37. })
  38. }
  39. },
  40. methods: {}
  41. }
  42. </script>
  43. <style scoped lang="scss">
  44. .table {
  45. padding: 30rpx;
  46. tr:nth-child(2n+1) {
  47. background-color: #F2F8FF !important;
  48. }
  49. tr:first-child {
  50. background-color: #F5F5F5 !important;
  51. }
  52. th {
  53. color: #777777;
  54. font-size: 28rpx;
  55. }
  56. td {
  57. color: #333333;
  58. font-size: 28rpx;
  59. }
  60. }
  61. </style>