| | |
| | | <div> |
| | | <!-- 右侧用户登录图标 --> |
| | | <div class="user-logininfo"> |
| | | <div class="user-logininfo-icon"> |
| | | <div class="logoIcon" v-if="logo"> |
| | | <div class="image"> |
| | | <img src="../../assets/logo.jpg" alt="" srcset="" /> |
| | | </div> |
| | | </div> |
| | | <div class="user-logininfo-icon" v-else> |
| | | <!-- 折叠 --> |
| | | <i @click="clickFold" class="el-icon-s-fold"></i> |
| | | <!-- 标签列表 --> |
| | |
| | | scrollTimer: null, |
| | | scrollAmount: 0 |
| | | } |
| | | }, |
| | | props: { |
| | | logo: { |
| | | type: String, |
| | | default: '' |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapState(['tagList', 'isFold']) |
| | |
| | | }, |
| | | // 跳转标签 |
| | | goTag(tag) { |
| | | this.$router.push({ |
| | | path: tag.path, |
| | | query: tag.query |
| | | }) |
| | | this.$router.push({ |
| | | path: tag.path, |
| | | query: tag.query |
| | | }) |
| | | }, |
| | | handleWheel(e) { |
| | | if (this.scrollTimer) { |
| | | this.scrollAmount += e.deltaY; |
| | | return; |
| | | } |
| | | |
| | | |
| | | const container = e.currentTarget; |
| | | this.scrollAmount = e.deltaY; |
| | | |
| | | |
| | | const scroll = () => { |
| | | container.scrollLeft += this.scrollAmount * 1.2; // 增加滚动速度 |
| | | this.scrollAmount = 0; |
| | | this.scrollTimer = null; |
| | | }; |
| | | |
| | | |
| | | this.scrollTimer = setTimeout(scroll, 8); // 减少延迟时间 |
| | | } |
| | | }, |
| | |
| | | justify-content: space-between; |
| | | overflow: hidden; |
| | | |
| | | .image { |
| | | // margin-top: 40px; |
| | | width: 70px; |
| | | height: 70px; |
| | | |
| | | img { |
| | | width: 100%; |
| | | height: 100%; |
| | | border-radius: 50%; |
| | | } |
| | | } |
| | | |
| | | .user-logininfo-icon { |
| | | margin-right: 30px; |
| | | flex: 1; |