mirror of
https://github.com/xfgryujk/blivechat.git
synced 2025-03-13 19:30:46 +08:00
将监听的event名称改为exampleResize
This commit is contained in:
parent
a69b6b6406
commit
ffc3c9d8a0
@ -71,12 +71,12 @@ export default {
|
||||
},
|
||||
created() {
|
||||
if (this.demo) {
|
||||
window.addEventListener('resize', this.scrollToBottom)
|
||||
window.addEventListener('exampleResize', this.scrollToBottom)
|
||||
}
|
||||
},
|
||||
beforeDestroy() {
|
||||
if (this.demo) {
|
||||
window.removeEventListener('resize', this.scrollToBottom)
|
||||
window.removeEventListener('exampleResize', this.scrollToBottom)
|
||||
}
|
||||
document.head.removeChild(this.styleElement)
|
||||
},
|
||||
|
@ -310,7 +310,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
const observer = new MutationObserver(() => window.dispatchEvent(new Event('resize')))
|
||||
const observer = new MutationObserver(() => window.dispatchEvent(new Event('exampleResize')))
|
||||
|
||||
const child = document.querySelector('#example-container')
|
||||
observer.observe(child, { attributes: true })
|
||||
|
Loading…
Reference in New Issue
Block a user