Merge branch 'develop'

Former-commit-id: c5fc070f7af3046385a1429ffcbffde07389f919 [formerly c5fc070f7af3046385a1429ffcbffde07389f919 [formerly c5fc070f7af3046385a1429ffcbffde07389f919 [formerly c5fc070f7af3046385a1429ffcbffde07389f919 [formerly 28707d68c220026a13f084fb330a2e07ed4e02f9 [formerly 07092395825ed208e026dd912c7914045b209a35]]]]]
Former-commit-id: f0a61eb4a38d78a17086eafc5d2674cbb94e2cbd
Former-commit-id: 8b525fde4dc9d0b819b7448f6bc0754b1e50cce3
Former-commit-id: f050b481897bbf5239f56445b5a7258c3759eee4 [formerly ff5f44be3a6f74a0eb6672d729e36c0349893a23]
Former-commit-id: 7cfb635350a0061635d3ad028f6b4166392bc9e6
Former-commit-id: db75f5be4b75e1a4fdf12b2fae8dd430bd9f7072
Former-commit-id: 23535d7fde91fbe3fa790cc3ca37c21dee5401d6
Former-commit-id: 19eff92bc2492238b583f7010140e72c60a09663
Former-commit-id: 25864f43ec16ffee6326682079e087440c0ecbcf
This commit is contained in:
liyang
2019-04-23 22:21:59 +08:00

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)
@@ -117,6 +117,7 @@ export default {
beforeDestroy () {
// 取消监听
window.removeEventListener('resize', this.throttledCheckScroll)
window.removeEventListener('load', this.checkScroll)
}
}
</script>