mobile.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <template>
  2. <div class="bbbb">
  3. <router-view />
  4. <div class="orientation-tip">
  5. <div>
  6. <img :src="require('@/assets/images/project/landtip.png')" alt="" />
  7. <p>为了更好的体验,请使用竖屏锁屏浏览</p>
  8. </div>
  9. </div>
  10. </div>
  11. </template>
  12. <script>
  13. import "@/assets/style/reset.less";
  14. import "@/assets/style/public.less";
  15. import "@/assets/theme/color.less";
  16. export default {};
  17. </script>
  18. <style lang="less">
  19. html,
  20. body,
  21. .bbbb {
  22. width: 100%;
  23. height: 100%;
  24. color: #fff;
  25. }
  26. /*横屏体验*/
  27. .orientation-tip {
  28. width: 100%;
  29. height: 100%;
  30. z-index: 10000;
  31. position: fixed;
  32. top: 0;
  33. left: 0;
  34. display: none;
  35. background-color: rgba(0, 0, 0, 0.8);
  36. > div {
  37. position: absolute;
  38. top: 50%;
  39. width: 100%;
  40. left: 50%;
  41. transform: translate(-50%, -50%);
  42. text-align: center;
  43. > img {
  44. }
  45. > p {
  46. font-size: 16px;
  47. margin-top: 20px;
  48. width: 100%;
  49. }
  50. }
  51. }
  52. /*竖屏*/
  53. @media screen and (orientation: portrait) {
  54. .orientation-tip {
  55. display: none;
  56. }
  57. }
  58. /*横屏*/
  59. @media screen and (orientation: landscape) {
  60. .orientation-tip {
  61. display: block;
  62. }
  63. }
  64. </style>