Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

App.vue 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <router-view></router-view>
  3. </template>
  4. <!--
  5. setup() :开始创建组件之前,在beforeCreate和created之前执行。创建的是data和method
  6. onBeforeMount() : 组件挂载到节点上之前执行的函数。
  7. onMounted() : 组件挂载完成后执行的函数。
  8. onBeforeUpdate(): 组件更新之前执行的函数。
  9. onUpdated(): 组件更新完成之后执行的函数。
  10. onBeforeUnmount(): 组件卸载之前执行的函数。
  11. onUnmounted(): 组件卸载完成后执行的函数
  12. 若组件被包含,则多出下面两个钩子函数。
  13. onActivated(): 被包含在中的组件,会多出两个生命周期钩子函数。被激活时执行 。
  14. onDeactivated(): 比如从 A组件,切换到 B 组件,A 组件消失时执行。
  15. -->
  16. <script lang="ts" setup>
  17. // window.addEventListener('error', (event) => {
  18. // console.log(event)
  19. // const tag: any = event.target;
  20. // if (tag.tagName === 'link' || tag.tagName === "script") {
  21. // location.reload();
  22. // }
  23. // alert('捕获到异常:' + tag + tag.tagName + '(请尝试刷新)')
  24. // }, true)
  25. </script>
  26. <style>
  27. html,
  28. body {
  29. height: 100%;
  30. width: 100%;
  31. border: hidden;
  32. overflow: hidden;
  33. padding: 0;
  34. margin: 0;
  35. font-family: Arial, sans-serif;
  36. }
  37. #app {
  38. width: 100%;
  39. height: 100%;
  40. font-family: 'Microsoft Yahei', Arial, sans-serif;
  41. }
  42. #app .content-warpper {
  43. padding: 0 22px 20px;
  44. /* background: #f8f8f8; */
  45. }
  46. </style>