index.tsx 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. import { defineComponent } from 'vue'
  2. import { ElButton } from 'element-plus'
  3. import './index.css'
  4. import logo from './images/logo.png'
  5. import { state } from '@/state'
  6. export default defineComponent({
  7. name: 'col-header',
  8. data() {
  9. return {
  10. navigator: [
  11. { name: '首页', href: '#', current: false },
  12. { name: '曲谱', href: '#', current: false },
  13. { name: '视频课', href: '#', current: false },
  14. { name: '云教练', href: '#', current: false },
  15. { name: '社区', href: '#', current: false },
  16. { name: '下载', href: '/downLoad', current: false }
  17. ]
  18. }
  19. },
  20. mounted() {},
  21. render() {
  22. return (
  23. <div class="topNav">
  24. <div class="mx-52 flex justify-between items-center h-[70px]">
  25. <div class="flex items-center h-full">
  26. <div class="logoWrap">
  27. <img class="w-full" src={logo} alt="" />
  28. </div>
  29. <div class="flex space-x-[76px] md:space-x-16 ml-28 sm:ml-20 h-full navWrap">
  30. {this.navigator.map((item: any) => (
  31. <a
  32. href={item.href}
  33. onClick={() => {
  34. this.navigator.forEach((item: any) => {
  35. item.current = false
  36. })
  37. item.current = true
  38. }}
  39. class={[
  40. item.current
  41. ? 'text-[#1FF0C9] border-b-[3px] border-b-[#1FF0C9]'
  42. : 'activeItem',
  43. 'itemCenter'
  44. ]}
  45. >
  46. {item.name}
  47. </a>
  48. ))}
  49. </div>
  50. </div>
  51. <div>
  52. <ElButton
  53. type="primary"
  54. round
  55. onClick={() => {
  56. state.loginPopupStatus = true
  57. }}
  58. >
  59. 登录/注册
  60. </ElButton>
  61. </div>
  62. </div>
  63. </div>
  64. )
  65. }
  66. })