新增窗口大小设置

This commit is contained in:
lyswhut
2019-10-22 01:25:03 +08:00
parent c97bc5edfc
commit 31e8b466cf
13 changed files with 118 additions and 18 deletions
+9 -6
View File
@@ -88,8 +88,6 @@ export default {
msDownX: 0,
msDownVolume: 0,
},
handleVolumeMsMoveFn: null,
handleVolumeMsUpFn: null,
}
},
computed: {
@@ -125,12 +123,14 @@ export default {
this.setVolume(volume)
}, 300)
document.addEventListener('mousemove', this.handleVolumeMsMoveFn = this.handleVolumeMsMove.bind(this))
document.addEventListener('mouseup', this.handleVolumeMsUpFn = this.handleVolumeMsUp.bind(this))
document.addEventListener('mousemove', this.handleVolumeMsMove)
document.addEventListener('mouseup', this.handleVolumeMsUp)
window.addEventListener('resize', this.handleResize)
},
beforeDestroy() {
document.removeEventListener('mousemove', this.handleVolumeMsMoveFn)
document.removeEventListener('mouseup', this.handleVolumeMsUpFn)
document.removeEventListener('mousemove', this.handleVolumeMsMove)
document.removeEventListener('mouseup', this.handleVolumeMsUp)
window.removeEventListener('resize', this.handleResize)
},
watch: {
changePlay(n) {
@@ -489,6 +489,9 @@ export default {
handleCopy(text) {
clipboardWriteText(text)
},
handleResize() {
this.setProgessWidth()
},
},
}
</script>