Configuration.vue 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <!--
  2. * @Author: Rindy
  3. * @Date: 2020-03-13 16:53:05
  4. * @LastEditors: Rindy
  5. * @LastEditTime: 2020-09-07 16:25:41
  6. * @Description: 注释
  7. -->
  8. <template>
  9. <div class="dev-system">
  10. <div class="container">
  11. <header>
  12. <span>系统设置</span>
  13. <span @click="onClose">
  14. <i class="iconfont icon_close"></i>
  15. </span>
  16. </header>
  17. <article>
  18. <div class="menu">
  19. <ul>
  20. <li v-for="(item,key) in menu" :key="key" @click="onMenuClick(item)">{{item.text}}</li>
  21. </ul>
  22. </div>
  23. <div class="page">
  24. <component :is="component"></component>
  25. </div>
  26. </article>
  27. </div>
  28. </div>
  29. </template>
  30. <script>
  31. export default {
  32. data() {
  33. return {
  34. menu: [{ text: "语言设置", name: "Lang" }, { text: '新闻设置', name: 'News'}],
  35. page: "Lang"
  36. };
  37. },
  38. computed: {
  39. component() {
  40. let page = this.page;
  41. return () => import(`@/components/dev/components/${page}.vue`);
  42. }
  43. },
  44. methods: {
  45. onClose() {
  46. document.body.removeChild(this.$el);
  47. this.$destroy();
  48. //this.$route.replace('/')
  49. },
  50. onMenuClick(item){
  51. this.page =item.name
  52. }
  53. }
  54. };
  55. </script>
  56. <style lang="less" scoped>
  57. .dev-system {
  58. padding: 20px;
  59. position: fixed;
  60. left: 0;
  61. top: 0;
  62. width: 100%;
  63. height: 100%;
  64. background-color: rgba(0, 0, 0, 0.3);
  65. z-index: 1000;
  66. color: #000;
  67. }
  68. .container {
  69. display: flex;
  70. width: 100%;
  71. height: 100%;
  72. background-color: #efefef;
  73. flex-direction: column;
  74. overflow: hidden;
  75. }
  76. header {
  77. padding: 0 10px;
  78. width: 100%;
  79. height: 30px;
  80. display: flex;
  81. align-items: center;
  82. justify-content: space-between;
  83. border-bottom: solid 1px #ccc;
  84. .icon_close {
  85. cursor: pointer;
  86. }
  87. }
  88. article {
  89. display: flex;
  90. flex: 1;
  91. width: 100%;
  92. height: 100%;
  93. overflow: hidden;
  94. }
  95. .menu {
  96. display: flex;
  97. width: 120px;
  98. height: 100%;
  99. border-right: solid 1px #ccc;
  100. ul {
  101. padding: 10px;
  102. li {
  103. cursor: pointer;
  104. margin-bottom: 10px;
  105. }
  106. }
  107. }
  108. .page {
  109. padding: 0 10px;
  110. display: flex;
  111. flex: 1;
  112. height: 100%;
  113. }
  114. </style>