修复初始刷新页面导致的顶部菜单滚动轴异常bug

Former-commit-id: 2b4afbe19591d83920da0a594c628c419d9fda25 [formerly 2b4afbe19591d83920da0a594c628c419d9fda25 [formerly 2b4afbe19591d83920da0a594c628c419d9fda25 [formerly 2b4afbe19591d83920da0a594c628c419d9fda25 [formerly a4f4fe6a4efa08a93ec74345bb4630fece1b0560 [formerly 7a54ed8bc65c87132d18f1e3ff3fd7b2c94212dc]]]]]
Former-commit-id: 86a7bdfe0575038ae12d52f26fd0bfa334b0b704
Former-commit-id: 1d908e75d462b1f490d85abe2a5eb6c07ef23aee
Former-commit-id: cc70ea58925cd8339b3fcf6c2236ddba4eecd6a5 [formerly 8583b31523987529d8aee76070e0955ead44ca02]
Former-commit-id: 95c8f7f88157d3ec99e36688f5315c5c4d274cc4
Former-commit-id: c6ef3f63dddd62d6725cd31ee3cbd0a8428e6a3b
Former-commit-id: 4d5008e488776faa64ceb843042973c6fcdb5061
Former-commit-id: 193fad7fdeb14fa41370b62ca9cc8f68c044ba1a
Former-commit-id: 70bb99b49d3b0d335dd74f13aa71c781193dd260
This commit is contained in:
Lu Chaohai
2019-04-10 08:13:42 +08:00
parent 0b27a30887
commit 16efba90cf

View File

@@ -109,7 +109,7 @@ export default {
mounted () {
// 初始化判断
// 默认判断父元素和子元素的大小,以确定初始情况是否显示滚动
this.checkScroll()
window.addEventListener('load', this.checkScroll)
// 全局窗口变化监听判断父元素和子元素的大小从而控制isScroll的开关
this.throttledCheckScroll = throttle(this.checkScroll, 300)
window.addEventListener('resize', this.throttledCheckScroll)