index.vue 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. <template>
  2. <div class="limit-purchase-container">
  3. <el-container>
  4. <el-header height="60px">
  5. <el-menu
  6. :default-active="activeMenu"
  7. mode="horizontal"
  8. @select="handleMenuSelect"
  9. class="el-menu-horizontal"
  10. >
  11. <el-menu-item index="limitPurchaseRule">
  12. <span>限购规则管理</span>
  13. </el-menu-item>
  14. </el-menu>
  15. </el-header>
  16. <el-main>
  17. <component
  18. :is="currentComponent"
  19. :axios-instance="axiosInstance"
  20. />
  21. </el-main>
  22. </el-container>
  23. </div>
  24. </template>
  25. <script>
  26. import LimitPurchaseRule from './LimitPurchaseRule.vue'
  27. export default {
  28. name: 'LimitPurchaseAdmin',
  29. components: {
  30. LimitPurchaseRule
  31. },
  32. props: {
  33. axiosInstance: {
  34. type: Object,
  35. default: null
  36. }
  37. },
  38. data() {
  39. return {
  40. activeMenu: 'limitPurchaseRule'
  41. }
  42. },
  43. computed: {
  44. currentComponent() {
  45. if (this.activeMenu === 'limitPurchaseRule') {
  46. return 'LimitPurchaseRule'
  47. }
  48. return 'LimitPurchaseRule'
  49. }
  50. },
  51. methods: {
  52. handleMenuSelect(key) {
  53. this.activeMenu = key
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. .limit-purchase-container {
  60. padding: 0;
  61. height: calc(100vh - 120px);
  62. }
  63. .el-menu-horizontal {
  64. height: 60px;
  65. font-size: 16px;
  66. }
  67. .el-header {
  68. padding: 0;
  69. background-color: #fff;
  70. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  71. }
  72. .el-main {
  73. padding: 30px;
  74. background: #fff;
  75. margin: 20px;
  76. border-radius: 8px;
  77. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  78. flex: 1;
  79. }
  80. </style>