App.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. }
  23. /*横屏体验*/
  24. .orientation-tip {
  25. width: 100%;
  26. height: 100%;
  27. z-index: 10000;
  28. position: fixed;
  29. top: 0;
  30. left: 0;
  31. display: none;
  32. background-color: rgba(0, 0, 0, 0.8);
  33. > div {
  34. position: absolute;
  35. top: 50%;
  36. width: 100%;
  37. left: 50%;
  38. transform: translate(-50%, -50%);
  39. text-align: center;
  40. > img {
  41. width: 20%;
  42. }
  43. > p {
  44. font-size: 16px;
  45. margin-top: 20px;
  46. width: 100%;
  47. }
  48. }
  49. }
  50. /*竖屏*/
  51. @media screen and (orientation: portrait) {
  52. .orientation-tip {
  53. display: none;
  54. }
  55. }
  56. /*横屏*/
  57. @media screen and (orientation: landscape) {
  58. .orientation-tip {
  59. display: block;
  60. }
  61. }
  62. </style>