feat: v1.20.1

This commit is contained in:
FairyEver
2020-09-27 22:58:31 +08:00
parent 073b7dcfed
commit 3efa812f25
2 changed files with 2 additions and 3 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "d2-admin", "name": "d2-admin",
"version": "1.20.0", "version": "1.20.1",
"scripts": { "scripts": {
"serve": "vue-cli-service serve --open", "serve": "vue-cli-service serve --open",
"start": "npm run serve", "start": "npm run serve",
@@ -128,7 +128,7 @@ export default {
mounted () { mounted () {
// 初始化判断 // 初始化判断
// 默认判断父元素和子元素的大小,以确定初始情况是否显示滚动 // 默认判断父元素和子元素的大小,以确定初始情况是否显示滚动
window.addEventListener('load', this.checkScroll) this.checkScroll()
// 全局窗口变化监听,判断父元素和子元素的大小,从而控制isScroll的开关 // 全局窗口变化监听,判断父元素和子元素的大小,从而控制isScroll的开关
this.throttledCheckScroll = throttle(this.checkScroll, 300) this.throttledCheckScroll = throttle(this.checkScroll, 300)
window.addEventListener('resize', this.throttledCheckScroll) window.addEventListener('resize', this.throttledCheckScroll)
@@ -136,6 +136,5 @@ export default {
beforeDestroy () { beforeDestroy () {
// 取消监听 // 取消监听
window.removeEventListener('resize', this.throttledCheckScroll) window.removeEventListener('resize', this.throttledCheckScroll)
window.removeEventListener('load', this.checkScroll)
} }
} }