Audio.vue 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <div>
  3. <!--电影列表,与推荐列表-->
  4. <el-row id="movie-list">
  5. <!--电影列表-->
  6. <el-col :md="18">
  7. <el-col v-for="(video, index) in videoList" :key="index" :md="6" :sm="12" :xs="12">
  8. </el-col>
  9. <!--
  10. 分页按钮:
  11. page-size:每页显示条数
  12. total:总条数
  13. hide-on-single-page: 页数为一时隐藏
  14. -->
  15. <el-col :span="24" class="pagination">
  16. <el-pagination
  17. background
  18. :small="screenWidth <= 768"
  19. hide-on-single-page
  20. layout="prev, pager, next"
  21. :page-size="pageSize"
  22. :current-page="currentPage"
  23. :total="totalSize"
  24. />
  25. </el-col>
  26. </el-col>
  27. </el-row>
  28. <el-row v-if="showEmpty" class="not-result">
  29. <el-col :span="12" :offset="6">
  30. <img src="@/assets/img/icon/not-result.png">
  31. <div>没有音频数据</div>
  32. </el-col>
  33. </el-row>
  34. </div>
  35. </template>
  36. <script>
  37. export default {
  38. name: 'Audio',
  39. components: {},
  40. data() {
  41. return {
  42. // 屏幕宽度, 为了控制分页条的大小
  43. screenWidth: document.body.clientWidth,
  44. currentPage: 1,
  45. pageSize: 12,
  46. totalPages: 0,
  47. totalSize: 0,
  48. videoList: [],
  49. showEmpty: true
  50. }
  51. },
  52. created() {
  53. document.title = '音频'
  54. },
  55. mounted() {
  56. // 当窗口宽度改变时获取屏幕宽度
  57. window.onresize = () => {
  58. return () => {
  59. window.screenWidth = document.body.clientWidth
  60. this.screenWidth = window.screenWidth
  61. }
  62. }
  63. },
  64. methods: {
  65. }
  66. }
  67. </script>
  68. <style scoped>
  69. #movie-list {
  70. padding-top: 15px;
  71. padding-left: 6%;
  72. padding-right: 6%;
  73. }
  74. .not-result {
  75. padding-top: 100px;
  76. padding-bottom: 100px;
  77. text-align: center;
  78. }
  79. .pagination {
  80. text-align: center;
  81. padding: 10px;
  82. }
  83. /*处于手机屏幕时*/
  84. @media screen and (max-width: 768px){
  85. #movie-list {
  86. padding-top: 8px;
  87. padding-left: 0.5%;
  88. padding-right: 0.5%;
  89. }
  90. }
  91. </style>