窗口缩放时滚动

This commit is contained in:
simon3000 2019-07-11 21:50:28 +02:00
parent 26f19b6630
commit 273dc0f43f
No known key found for this signature in database
GPG Key ID: 9E04DC65786E7851

View File

@ -65,7 +65,11 @@ export default {
this.styleElement.innerText = this.css
this.scrollToBottom()
},
created() {
window.addEventListener('resize', this.scrollToBottom)
},
beforeDestroy() {
window.removeEventListener('resize', this.scrollToBottom)
document.head.removeChild(this.styleElement)
},
updated() {