App.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <template>
  2. <div class="out-box">
  3. <template v-if="!$route.meta.full">
  4. <myHeader />
  5. <div class="w1320" style="height:calc(100% - 120px);">
  6. <myNav />
  7. <a-config-provider :locale="zh_CN">
  8. <router-view style="background-color: #fff;flex:1" />
  9. </a-config-provider>
  10. </div>
  11. </template>
  12. <template v-if="$route.meta.full">
  13. <a-config-provider :locale="zh_CN">
  14. <router-view style="background-color: #fff;flex:1" />
  15. </a-config-provider>
  16. </template>
  17. </div>
  18. </template>
  19. <script>
  20. import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN';
  21. import myHeader from './components/myHeader.vue'
  22. import myNav from './components/myNav.vue'
  23. export default {
  24. components: {
  25. myHeader,
  26. myNav
  27. },
  28. data() {
  29. return {
  30. zh_CN,
  31. }
  32. },
  33. watch: {
  34. $route(nval) {
  35. //清空编辑状态
  36. if (this.$store.state.questionEdit) {
  37. this.$store.commit('changeQuestionEdit', false)
  38. }
  39. }
  40. },
  41. created() {
  42. let testBox = this.$storage.get('testBox');
  43. if (!testBox || testBox == null) {
  44. this.$storage.set('testBox', []);
  45. } else {
  46. this.$store.commit('setTestBox', testBox)
  47. }
  48. },
  49. mounted() {
  50. let token = localStorage.getItem("Token");
  51. if (!token || this.$route.name === 'login') { return; }
  52. this.$store.dispatch('EducationCategoryGetList')
  53. this.$store.dispatch('GradeGetList')
  54. this.$store.dispatch('DisciplineGetList')
  55. this.$store.dispatch('GetQuestionTypeList')
  56. this.$store.dispatch('GetDifficulty')
  57. }
  58. }
  59. </script>
  60. <style lang="less">
  61. html {
  62. background-color: #f2f2f2;
  63. }
  64. #app {
  65. font-family: Avenir, Helvetica, Arial, sans-serif;
  66. -webkit-font-smoothing: antialiased;
  67. -moz-osx-font-smoothing: grayscale;
  68. color: #2c3e50;
  69. background-color: #f2f2f2;
  70. }
  71. .out-box {
  72. width: 100%;
  73. height: 100%;
  74. position: fixed;
  75. top: 0;
  76. left: 0;
  77. background-color: #f2f2f2;
  78. }
  79. </style>