App.vue 743 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <template>
  2. <div id="app">
  3. <Router-view />
  4. </div>
  5. </template>
  6. <script>
  7. export default {
  8. created() {
  9. // 移动端和pc端的切换
  10. if (
  11. window.navigator.userAgent.match(
  12. /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  13. )
  14. ) {
  15. // 移动端
  16. if (window.location.href.includes('en.capitalmuseum.org.cn')) {
  17. window.location.href = window.location.origin + '/mobile/index.html#/Layout/Home'
  18. setTimeout(() => {
  19. location.reload(true);
  20. }, 200);
  21. }
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang='less' scoped>
  27. #app {
  28. width: 100%;
  29. // min-width: 1280px;
  30. }
  31. </style>