App.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="vvvv">
  3. <router-view/>
  4. <div class="orientation-tip" v-if="isMobile">
  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. export default {
  16. }
  17. </script>
  18. <style lang="less">
  19. .vvvv{
  20. width: 100%;
  21. height: 100vh;
  22. min-width: 1918px;
  23. min-height: 900px;
  24. }
  25. /*横屏体验*/
  26. .orientation-tip {
  27. width: 100%;
  28. height: 100%;
  29. z-index: 10000;
  30. position: fixed;
  31. top: 0;
  32. left: 0;
  33. display: none;
  34. background-color: rgba(0, 0, 0, 0.8);
  35. > div {
  36. position: absolute;
  37. top: 50%;
  38. width: 100%;
  39. left: 50%;
  40. transform: translate(-50%, -50%);
  41. text-align: center;
  42. > img {
  43. width: 20%;
  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>