Logo.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="logo">
  3. <router-link :to="routerLinkTo">
  4. <!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo颜色根据主题颜色变化 -->
  5. <img v-if="navTheme === 'dark'" src="~@/assets/logo.png" alt="logo">
  6. <img v-else src="~@/assets/logo.png" alt="logo">
  7. <!-- update-begin- author:sunjianlei --- date:20190814 --- for: logo颜色根据主题颜色变化 -->
  8. <h1 v-if="showTitle">{{ title }}</h1>
  9. </router-link>
  10. </div>
  11. </template>
  12. <script>
  13. import { mixin } from '@/utils/mixin.js'
  14. export default {
  15. name: 'Logo',
  16. mixins: [mixin],
  17. props: {
  18. title: {
  19. type: String,
  20. default: '山东省省级土地资产信息管理系统',//山东省省级土地资产
  21. required: false
  22. },
  23. showTitle: {
  24. type: Boolean,
  25. default: true,
  26. required: false
  27. },
  28. // 点击Logo跳转地址
  29. routerLinkTo: {
  30. type: Object,
  31. default: () => ({name: 'dashboard'}),
  32. },
  33. }
  34. }
  35. </script>
  36. <style lang="less" scoped>
  37. /*缩小首页布 局顶部的高度*/
  38. @height: 59px;
  39. .sider {
  40. box-shadow: none !important;
  41. .logo {
  42. height: @height !important;
  43. width: 500px;
  44. line-height: @height !important;
  45. box-shadow: none !important;
  46. transition: background 300ms;
  47. a {
  48. color: white;
  49. &:hover {
  50. color: rgba(255, 255, 255, 0.8);
  51. }
  52. }
  53. }
  54. &.light .logo {
  55. background-color: @primary-color;
  56. }
  57. }
  58. </style>