App.vue 873 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <script setup lang="ts">
  2. import { onBeforeMount } from "vue";
  3. import { RouterView } from "vue-router";
  4. onBeforeMount(() => {
  5. // 移动端和pc端的切换
  6. if (
  7. window.navigator.userAgent.match(
  8. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  9. )
  10. ) {
  11. // 移动端
  12. if (window.location.href.indexOf("en.capitalmuseum.org.cn") > -1) {
  13. window.location.href =
  14. window.location.origin + "/mobile/index.html#/Layout/Home";
  15. setTimeout(() => {
  16. location.reload();
  17. }, 200);
  18. }
  19. }
  20. });
  21. </script>
  22. <template>
  23. <RouterView />
  24. </template>
  25. <style lang="scss">
  26. body.aria-active {
  27. margin-top: 105px;
  28. }
  29. .van-swipe {
  30. cursor: default !important;
  31. }
  32. .container {
  33. margin: 0 auto;
  34. width: 100%;
  35. max-width: 1200px;
  36. }
  37. </style>