一、底部导航的编写

image.png

被点击当前路由颜色改变

  1. #app #nav .router-link-active{
  2. color: red;
  3. }
  1. <template>
  2. <div id="app">
  3. <div id="nav">
  4. <router-link class="taber" to="/music">
  5. <i class="iconfont logo">&#xe680;</i>
  6. 音乐
  7. </router-link>
  8. <router-link class="taber" to="/mv">
  9. <i class="iconfont logo">&#xe609;</i>
  10. mv</router-link>
  11. </div>
  12. <router-view></router-view>
  13. </div>
  14. </template>
  15. #app {
  16. width:10rem;
  17. margin-left:auto;
  18. margin-right:auto;
  19. position: relative;
  20. background: linear-gradient(pink,white);
  21. position: relative;
  22. }
  23. #nav{
  24. position: fixed;
  25. top:955px;
  26. background: #fff;
  27. width: 100%;
  28. height: 100px;
  29. z-index: 900;
  30. }
  31. .icon{
  32. width: 30px;
  33. height: 30px;
  34. display: block;
  35. }
  36. .taber{
  37. width: 400px;
  38. display: inline-block;
  39. text-align: center;
  40. text-decoration: none;
  41. color: gray;
  42. font-size: 25px;
  43. line-height: 40px;
  44. }
  45. .logo{
  46. display: block;
  47. font-size: 35px;
  48. margin-top: 20px;
  49. }