AppMain.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <section class="app-main" id="appMain">
  3. <!-- <el-button type="success" style="width:16%;margin-left: 0" @click="uploadRouteTable">上传路由表</el-button> -->
  4. <transition name="fade-transform" mode="out-in">
  5. <!-- <keep-alive> -->
  6. <router-view :key="key" />
  7. <!-- </keep-alive> -->
  8. </transition>
  9. </section>
  10. </template>
  11. <script>
  12. import { asyncRoutes } from '@/router/router.config'
  13. import { uploadRoute } from '@/api/user'
  14. export default {
  15. name: 'AppMain',
  16. computed: {
  17. key() {
  18. return this.$route.path
  19. }
  20. },
  21. methods: {
  22. uploadRouteTable() {
  23. const data = {
  24. '1': JSON.stringify({
  25. name: 'sys',
  26. value: asyncRoutes,
  27. type: 'tofly-master',
  28. notes: '使用与当前系统。'
  29. })
  30. }
  31. uploadRoute(JSON.stringify(data)).then(res => {
  32. this.$message.success('上传成功')
  33. })
  34. }
  35. }
  36. }
  37. </script>
  38. <style scoped>
  39. .app-main {
  40. min-height: calc(100vh - 64px);
  41. width: 100%;
  42. overflow: hidden;
  43. background: #ffffff;
  44. padding: 10px 20px;
  45. }
  46. .fixed-header + .app-main {
  47. padding-top: 26px;
  48. }
  49. </style>
  50. <style lang="scss">
  51. .el-popup-parent--hidden {
  52. .fixed-header {
  53. padding-right: 15px;
  54. }
  55. }
  56. </style>