天波用户运营管理后台系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.3KB

  1. <!--
  2. * @Date: 2021-11-29 11:20:34
  3. * @LastEditors: JinxuChen
  4. * @LastEditTime: 2021-12-10 10:42:56
  5. * @FilePath: \GpsCardAdmin\src\App.vue
  6. * @description:
  7. -->
  8. <template>
  9. <div id="app">
  10. <router-view v-if="isRouterAlive" />
  11. </div>
  12. </template>
  13. <script>
  14. import { VersionModel } from "./utils/model";
  15. export default {
  16. name: "App",
  17. provide() {
  18. return {
  19. reload: this.reload
  20. };
  21. },
  22. data() {
  23. return {
  24. isRouterAlive: true
  25. };
  26. },
  27. methods: {
  28. reload() {
  29. this.isRouterAlive = false;
  30. this.$nextTick(() => {
  31. this.isRouterAlive = true;
  32. console.log("reload");
  33. });
  34. },
  35. debug() {
  36. if (process.env.NODE_ENV !== "production" && document.body.clientWidth - 1 < 991) {
  37. const script = document.createElement("script");
  38. script.src = "//cdn.jsdelivr.net/npm/eruda";
  39. document.body.appendChild(script);
  40. script.onload = function() {
  41. eruda.init();
  42. };
  43. }
  44. }
  45. },
  46. mounted() {
  47. this.debug();
  48. console.log("当前版本是::", VersionModel);
  49. console.log("当前环境是::", process.env.NODE_ENV);
  50. }
  51. };
  52. </script>