1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
<template> <div class="header"> <div class="slogan"> <p>老男孩IT教育 | 帮助有志向的年轻人通过努力学习获得体面的工作和生活</p> </div> <div class="nav"> <ul class="left-part"> <li class="logo"> <router-link to="/"> <img src="../assets/img/head-logo.svg" alt=""> </router-link> </li> <li class="ele"> <span @click="goPage('/free-course')" :class="{active: url_path === '/free-course'}">免费课</span> </li> <li class="ele"> <span @click="goPage('/actual-course')" :class="{active: url_path === '/actual-course'}">实战课</span> </li> <li class="ele"> <span @click="goPage('/light-course')" :class="{active: url_path === '/light-course'}">轻课</span> </li> </ul>
<div class="right-part"> <div> <span>登录</span> <span class="line">|</span> <span>注册</span> </div> </div> </div> </div>
</template>
<script>
export default { name: "Header", data() { return { url_path: sessionStorage.url_path || '/', } }, methods: { goPage(url_path) {
</script>
<style scoped> .header { background-color: white; box-shadow: 0 0 5px 0 #aaa; }
.header:after { content: ""; display: block; clear: both; }
.slogan { background-color: #eee; height: 40px; }
.slogan p { width: 1200px; margin: 0 auto; color: #aaa; font-size: 13px; line-height: 40px; }
.nav { background-color: white; user-select: none; width: 1200px; margin: 0 auto;
}
.nav ul { padding: 15px 0; float: left; }
.nav ul:after { clear: both; content: ''; display: block; }
.nav ul li { float: left; }
.logo { margin-right: 20px; }
.ele { margin: 0 20px; }
.ele span { display: block; font: 15px/36px '微软雅黑'; border-bottom: 2px solid transparent; cursor: pointer; }
.ele span:hover { border-bottom-color: orange; }
.ele span.active { color: orange; border-bottom-color: orange; }
.right-part { float: right; }
.right-part .line { margin: 0 10px; }
.right-part span { line-height: 68px; cursor: pointer; } </style>
|