Logo.vue 956 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <div class="logo">
  3. <router-link :to="{name:'dashboard'}">
  4. <img src="~@/assets/logo.png" alt="logo">
  5. <h1 v-if="showTitle">{{ title }}</h1>
  6. </router-link>
  7. </div>
  8. </template>
  9. <script>
  10. export default {
  11. name: 'Logo',
  12. props: {
  13. title: {
  14. type: String,
  15. default: '',
  16. required: false
  17. },
  18. showTitle: {
  19. type: Boolean,
  20. default: false,
  21. required: false
  22. }
  23. }
  24. }
  25. </script>
  26. <style lang="scss" scoped>
  27. /*缩小首页布 局顶部的高度*/
  28. $height: 59px;
  29. .sider {
  30. box-shadow: none !important;
  31. .logo {
  32. height: $height !important;
  33. line-height: $height !important;
  34. box-shadow: none !important;
  35. transition: background 300ms;
  36. a {
  37. color: white;
  38. &:hover {
  39. color: rgba(255, 255, 255, 0.8);
  40. }
  41. }
  42. }
  43. &.light .logo {
  44. background-color: #1890ff;
  45. }
  46. }
  47. </style>