App.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <template>
  2. <div class="m3" v-if="auth">
  3. <Header :auth="auth.signedUser" class="header"></Header>
  4. <div class="main">
  5. <SideBar class="sidebar" :auth="auth.signedUser" :global="global"></SideBar>
  6. <MainView :auth="auth" :global="global" class="content"></MainView>
  7. </div>
  8. <Footer :auth="auth" v-if="layout.footer.show"></Footer>
  9. </div>
  10. </template>
  11. <script>
  12. import MainView from './components/MainView';
  13. import Header from './components/layout/Header';
  14. import Footer from './components/layout/Footer';
  15. import SideBar from './components/layout/SideBar';
  16. export default {
  17. name: 'app',
  18. components: {
  19. Header,
  20. MainView,
  21. Footer,
  22. SideBar
  23. },
  24. data(){
  25. return {
  26. global: null,
  27. auth: null,
  28. layout: {
  29. header: {
  30. show: true
  31. },
  32. sidebar: {
  33. show: true
  34. },
  35. footer: {
  36. show: false
  37. }
  38. }
  39. }
  40. },
  41. created(){
  42. let init = ()=>{
  43. let timer = setInterval(()=>{
  44. try{
  45. this.m3.init();
  46. window.global = this.global = this.m3.global;
  47. this.auth = this.m3.auth;
  48. if(this.m3.auth && this.m3.global){
  49. clearTimeout(timer);
  50. }
  51. }catch(err){
  52. console.error(err);
  53. }
  54. },200);
  55. };
  56. init();
  57. }
  58. }
  59. </script>
  60. <style>
  61. body{
  62. font-size: 12px;
  63. font-family: "PingFang SC",Arial,"Microsoft YaHei",sans-serif;
  64. margin: 0px;
  65. padding: 0px;
  66. overflow: hidden;
  67. }
  68. .el-menu .svg-icon{
  69. width: 1.2em!important;
  70. height: 1.2em!important;
  71. padding: 0px 5px 0 0;
  72. }
  73. .main{
  74. padding-top: 50px;
  75. display: flex;
  76. }
  77. </style>