index.vue 945 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <div>
  3. <el-menu
  4. :default-active="activeIndex"
  5. class="el-menu-demo"
  6. mode="horizontal"
  7. @select="handleSelect"
  8. :background-color="variables.navbarBg"
  9. :text-color="variables.navbarText"
  10. :active-text-color="variables.navbarActiveText">
  11. <el-menu-item index="1">学员系统</el-menu-item>
  12. </el-menu>
  13. </div>
  14. </template>
  15. <script>
  16. import variables from '@/styles/variables.scss'
  17. export default {
  18. name: 'NavMenu',
  19. data() {
  20. return {
  21. activeIndex: '1',
  22. }
  23. },
  24. computed: {
  25. variables() {
  26. return variables
  27. },
  28. },
  29. mounted() {
  30. },
  31. methods: {
  32. handleSelect(key, keyPath) {
  33. console.log(key, keyPath);
  34. }
  35. }
  36. }
  37. </script>
  38. <style lang="scss" scoped>
  39. .el-menu--horizontal {
  40. >.el-menu-item {
  41. height: 50px;
  42. line-height: 50px;
  43. &.is-active {
  44. background: #3f62ca !important;
  45. }
  46. }
  47. }
  48. </style>