handleScrollx() {
(document.querySelector('.el-drawer__wrapper') as any).style.top = 176 - window.pageYOffset + 'px';
}
mounted() {
window.addEventListener('scroll', this.handleScrollx, true);
}
beforeDestroy() {
window.removeEventListener('scroll', this.handleScrollx, true);
}
效果如下: