swiper.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width,initial-scale=1.0">
  7. <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  8. <META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
  9. <META HTTP-EQUIV="Expires" CONTENT="0">
  10. <link rel="stylesheet" href="https://cdn.staticfile.org/Swiper/8.0.7/swiper-bundle.min.css">
  11. </link>
  12. <script src="https://cdn.staticfile.org/Swiper/8.0.7/swiper-bundle.min.js"></script>
  13. <script src="https://cdn.staticfile.org/vue/2.6.0/vue.min.js"></script>
  14. <title>data数据大屏</title>
  15. <style>
  16. * {
  17. padding: 0;
  18. margin: 0;
  19. }
  20. body,
  21. html,
  22. #app {
  23. height: 100%;
  24. }
  25. html,
  26. body {
  27. position: relative;
  28. height: 100%;
  29. }
  30. .swiper,
  31. .swiper-wrapper,
  32. .swiper-slide {
  33. width: 100%;
  34. height: 100%;
  35. }
  36. .swiper-slide iframe {
  37. width: 100%;
  38. height: 100%;
  39. }
  40. </style>
  41. <script>
  42. function GetQueryString(name) {
  43. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
  44. var r = window.location.search.substr(1).match(reg);
  45. if (r != null) return unescape(r[2]); return null;
  46. }
  47. </script>
  48. </head>
  49. <body>
  50. <div id="app">
  51. <div class="swiper">
  52. <div class="swiper-wrapper">
  53. <div class="swiper-slide" v-for="(item,index) in list" :key="index">
  54. <iframe :src="`./view.html?id=`+item" frameborder="0"></iframe>
  55. </div>
  56. </div>
  57. </div>
  58. <div class="swiper-button-prev"></div>
  59. <div class="swiper-button-next"></div>
  60. </div>
  61. <script>
  62. new Vue({
  63. el: '#app',
  64. data() {
  65. return {
  66. id: GetQueryString('id'),
  67. list: [],
  68. }
  69. },
  70. created() {
  71. this.list = this.id.split(',')
  72. },
  73. mounted() {
  74. new Swiper('.swiper', {
  75. loop: true,
  76. autoplay: true,
  77. delay: 3000,
  78. navigation: {
  79. nextEl: '.swiper-button-next',
  80. prevEl: '.swiper-button-prev',
  81. }
  82. })
  83. }
  84. })
  85. </script>
  86. </body>
  87. </html>