File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/layout/components/TagsView Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,21 @@ export default {
1919 return this .$refs .scrollContainer .$refs .wrap
2020 }
2121 },
22+ mounted () {
23+ this .scrollWrapper .addEventListener (' scroll' , this .emitScroll , true )
24+ },
25+ beforeDestroy () {
26+ this .scrollWrapper .removeEventListener (' scroll' , this .emitScroll )
27+ },
2228 methods: {
2329 handleScroll (e ) {
2430 const eventDelta = e .wheelDelta || - e .deltaY * 40
2531 const $scrollWrapper = this .scrollWrapper
2632 $scrollWrapper .scrollLeft = $scrollWrapper .scrollLeft + eventDelta / 4
2733 },
34+ emitScroll () {
35+ this .$emit (' scroll' )
36+ },
2837 moveToTarget (currentTag ) {
2938 const $container = this .$refs .scrollContainer .$el
3039 const $containerWidth = $container .offsetWidth
Original file line number Diff line number Diff line change 11<template >
22 <div id =" tags-view-container" class =" tags-view-container" >
3- <scroll-pane ref =" scrollPane" class =" tags-view-wrapper" >
3+ <scroll-pane ref =" scrollPane" class =" tags-view-wrapper" @scroll = " handleScroll " >
44 <router-link
55 v-for =" tag in visitedViews"
66 ref =" tag"
@@ -189,6 +189,9 @@ export default {
189189 },
190190 closeMenu () {
191191 this .visible = false
192+ },
193+ handleScroll () {
194+ this .closeMenu ()
192195 }
193196 }
194197}
You can’t perform that action at this time.
0 commit comments