企微助手 ,仓库名 短剧

App.vue 2.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. <template>
  2. <div id="app">
  3. <div id="warning_sorry" v-if="isIEfalg">
  4. <div class="app_sorry">抱歉&ensp;&ensp;为了保证产品体验,建议您用其他浏览器!</div>
  5. </div>
  6. <router-view v-if="isRouterAlive" />
  7. </div>
  8. </template>
  9. <script>
  10. import permissionInit from '@/router/permission.js'
  11. export default {
  12. name: 'App',
  13. provide () {
  14. return {
  15. reload: this.reload
  16. }
  17. },
  18. data () {
  19. return {
  20. isIEfalg: false,
  21. isRouterAlive: true,
  22. }
  23. },
  24. created () {
  25. this.IEVersion()
  26. },
  27. mounted () {
  28. },
  29. methods: {
  30. reload () {
  31. //路由跳转到当前页面时,页面刷新
  32. this.isRouterAlive = false;
  33. this.$nextTick(function () {
  34. this.isRouterAlive = true;
  35. })
  36. },
  37. IEVersion () {//判断是否是ie浏览器
  38. var userAgent = navigator.userAgent; //取得浏览器的userAgent字符串
  39. var isIE = userAgent.indexOf("compatible") > -1 && userAgent.indexOf("MSIE") > -1; //判断是否IE<11浏览器
  40. var isEdge = userAgent.indexOf("Edge") > -1 && !isIE; //判断是否IE的Edge浏览器
  41. var isIE11 = userAgent.indexOf('Trident') > -1 && userAgent.indexOf("rv:11.0") > -1;
  42. if (isIE) {
  43. this.isIEfalg = true;
  44. } else if (isEdge) {
  45. // return 'edge';//edge
  46. } else if (isIE11) {
  47. //IE11
  48. this.isIEfalg = true;
  49. }
  50. },
  51. }
  52. }
  53. </script>
  54. <style lang="scss">
  55. @import "@/style/common.scss";
  56. #app {
  57. background: #f5f6f8;
  58. min-height: 100vh;
  59. width: 100%;
  60. font-family: "Noto Sans SC";
  61. }
  62. #warning_sorry {
  63. display: -webkit-box;
  64. display: -moz-box;
  65. display: -ms-flexbox;
  66. display: -webkit-flex;
  67. display: flex;
  68. justify-content: space-between;
  69. align-items: center;
  70. font-size: 16px;
  71. width: 40%;
  72. background: rgba(0, 0, 0, 0.6);
  73. padding: 20px;
  74. box-sizing: border-box;
  75. color: #333333;
  76. margin: auto;
  77. margin-top: 15px;
  78. position: fixed;
  79. bottom: 100px;
  80. left: 0;
  81. right: 0;
  82. margin: auto;
  83. color: #fffff3;
  84. z-index: 99;
  85. .right {
  86. color: #0099cc;
  87. }
  88. .app_sorry::before {
  89. content: "";
  90. display: inline-block;
  91. width: 6px;
  92. height: 20px;
  93. background: red;
  94. vertical-align: text-bottom;
  95. margin-right: 10px;
  96. }
  97. }
  98. </style>