App.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <template>
  2. <div id="app">
  3. <!-- <router-view /> -->
  4. <keep-alive :include="cachedViews">
  5. <router-view></router-view>
  6. </keep-alive>
  7. </div>
  8. </template>
  9. <script>
  10. import { delAllTabsKey } from "@/util/keyData";
  11. import { mapState } from "vuex";
  12. export default {
  13. name: "app",
  14. data() {
  15. return {};
  16. },
  17. watch: {
  18. cachedViews: {
  19. handler(val) {
  20. console.log('监听组件暂存',val);
  21. },
  22. deep: true,
  23. immediate: true
  24. }
  25. },
  26. mounted() {
  27. //刷新浏览器清除标签key
  28. delAllTabsKey("ALL");
  29. },
  30. methods: {},
  31. computed: {
  32. ...mapState({
  33. cachedViews: state => state.tags.cachedViews
  34. })
  35. }
  36. };
  37. </script>
  38. <style lang="scss">
  39. #app {
  40. width: 100%;
  41. height: 100%;
  42. overflow: hidden;
  43. }
  44. .el-input.is-disabled .el-input__inner {
  45. color: #000000 !important;
  46. background-color: #fafafa !important;
  47. }
  48. .el-textarea.is-disabled .el-textarea__inner {
  49. color: #000000 !important;
  50. background-color: #fafafa !important;
  51. }
  52. .el-range-editor.is-disabled input {
  53. color: #000000 !important;
  54. background-color: #fafafa !important;
  55. }
  56. .el-dialog__headerbtn {
  57. top: 9px !important;
  58. }
  59. .el-dialog__headerbtn {
  60. margin-top: 5px !important;
  61. }
  62. </style>