This commit is contained in:
syuilo 2020-08-22 09:24:13 +09:00
parent d9a5633e48
commit ce21f67478
1 changed files with 4 additions and 1 deletions

View File

@ -267,7 +267,10 @@ export default defineComponent({
if (!this.isDesktop) return;
if (this.$store.state.device.fixedWidgetsPosition) return;
const stickyWidgetColumns = this.$refs.widgets.map(w => new StickySidebar(w.children[1], w.children[0], w.offsetTop));
// NOTE: Vue3 this.$refs.widgets
const widgets = Array.isArray(this.$refs.widgets) ? this.$refs.widgets : [this.$refs.widgets];
const stickyWidgetColumns = widgets.map(w => new StickySidebar(w.children[1], w.children[0], w.offsetTop));
window.addEventListener('scroll', () => {
for (const stickyWidgetColumn of stickyWidgetColumns) {
stickyWidgetColumn.calc(window.scrollY);