MenuPC.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <div class="pc-menu" :style="`width:${$i18n.t('style_key.menu_width')}`" app-border dir-right>
  3. <ul class="pc-menu-container">
  4. <li v-for="(item, key) in menu" v-show="!item.hidden" :class="{disable:key!=0&&!isShow}" :key="key">
  5. <router-link :to="item.link" :exact="false">
  6. <img class="normal" :src="require(`@/assets/images/icons/navs/${item.icon}_normal.svg`)" alt="">
  7. <img class="active" :src="require(`@/assets/images/icons/navs/${item.icon}_selected.svg`)" alt="">
  8. <span>{{ item.text }}</span>
  9. </router-link>
  10. </li>
  11. </ul>
  12. <a class="help" :href="$lang=='en'?'https://docs.4dkankan.com/#/product/4dpano/en-us/README':'https://docs.4dkankan.com/#/product/4dpano/zh-cn/README'" target="_blank">
  13. <img v-tooltip="$i18n.t('edit_settings.help_center')" :src="require(`@/assets/images/icons/help_tips.png`)" alt="">
  14. </a>
  15. </div>
  16. </template>
  17. <script>
  18. import { PCMenu } from "../config/menu";
  19. import { mapGetters } from "vuex";
  20. export default {
  21. name: "pc-menu",
  22. data() {
  23. return {
  24. menu: []
  25. };
  26. },
  27. computed: {
  28. ...mapGetters({
  29. isShow:'isShow'
  30. })
  31. },
  32. watch:{
  33. '$route.name':{
  34. immediate:true,
  35. handler:function (newVal) {
  36. if (newVal!='base'&&!this.isShow) {
  37. this.$router.push({path:'/base',redirect:true})
  38. }
  39. }
  40. }
  41. },
  42. mounted() {
  43. // 添加滚动条
  44. },
  45. created() {
  46. this.menu = PCMenu;
  47. }
  48. };
  49. </script>
  50. <style lang="less">
  51. .pc-menu {
  52. width: 58px;
  53. ul {
  54. li {
  55. cursor: pointer;
  56. text-align: center;
  57. white-space: normal;
  58. a {
  59. width: 100%;
  60. height: 100%;
  61. padding: 10px 5px;
  62. display: inline-block;
  63. >img{
  64. width: 18px;
  65. }
  66. .normal{
  67. display: inline-block;
  68. }
  69. .active{
  70. display: none;
  71. }
  72. &.router-link-exact-active,
  73. &.router-link-active {
  74. color: @color;
  75. background: #252526;
  76. .normal{
  77. display: none;
  78. }
  79. .active{
  80. display: inline-block;
  81. }
  82. }
  83. }
  84. }
  85. span {
  86. display: block;
  87. font-size: 12px;
  88. }
  89. a {
  90. color: #fff;
  91. text-decoration: none;
  92. }
  93. .iconfont {
  94. font-size: 28px;
  95. }
  96. }
  97. .help{
  98. position: absolute;
  99. bottom: 10px;
  100. left: 50%;
  101. width: 16px;
  102. transform: translateX(-50%);
  103. >img{
  104. width: 100%;
  105. }
  106. }
  107. }
  108. </style>