Logo.vue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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: false,
  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. width: 100vw;
  45. line-height: 59px !important;
  46. box-shadow: none !important;
  47. transition: background 300ms;
  48. a {
  49. color: white;
  50. &:hover {
  51. color: rgba(255, 255, 255, 0.8);
  52. }
  53. }
  54. // 重新定义图片大小
  55. img {
  56. height: 60px;
  57. }
  58. }
  59. // 系统顶部背景图设置
  60. &.light .logo {
  61. //background-color: @primary-color;
  62. background-image: url('../../assets/header-background.png');
  63. background-size: cover;
  64. //width: auto;
  65. }
  66. }
  67. </style>