index.vue 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <template>
  2. <div class="app">
  3. <div class="app-header">
  4. <layout-header />
  5. <bread-crumb />
  6. </div>
  7. <section class="app-main">
  8. <transition name="fade-transfrom" mode="out-in">
  9. <router-view :key="key"></router-view>
  10. </transition>
  11. </section>
  12. </div>
  13. </template>
  14. <script>
  15. import LayoutHeader from './components/LayoutHeader';
  16. import BreadCrumb from './components/BreadCrumb';
  17. export default {
  18. name: 'Layout',
  19. components: {
  20. LayoutHeader,
  21. BreadCrumb
  22. },
  23. computed: {
  24. key() {
  25. return this.$route.path;
  26. }
  27. },
  28. created() {
  29. window.onerror = function (msg, source, lineno, colno, error) {
  30. if (msg === 'Script error.' && lineno === 0 && colno === 0) return true;
  31. };
  32. }
  33. };
  34. </script>
  35. <style lang="scss">
  36. .app {
  37. height: 100%;
  38. padding-top: $header-h;
  39. &-header {
  40. position: fixed;
  41. top: 0;
  42. left: 0;
  43. width: 100%;
  44. }
  45. &-main {
  46. width: 100%;
  47. height: calc(100vh - #{$header-h});
  48. overflow-y: auto;
  49. background-color: $bacColor;
  50. }
  51. }
  52. </style>