Настроила скролл к текущему времени
This commit is contained in:
12437
package-lock.json
generated
12437
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,7 +9,7 @@
|
|||||||
@next-date="nextDate"
|
@next-date="nextDate"
|
||||||
@selected-layout="selectedLayout"
|
@selected-layout="selectedLayout"
|
||||||
)
|
)
|
||||||
.schedule-body(@scroll="changeScrollingState")
|
.schedule-body(@scroll="changeScrollingState", ref="scheduleBody")
|
||||||
.hiding-container.fixed(v-if="isScrolling")
|
.hiding-container.fixed(v-if="isScrolling")
|
||||||
.column-wrapper.flex.ml-20(:style="columnWrapperWidth")
|
.column-wrapper.flex.ml-20(:style="columnWrapperWidth")
|
||||||
calendar-column(
|
calendar-column(
|
||||||
@@ -320,6 +320,14 @@ export default {
|
|||||||
changeScrollingState(e) {
|
changeScrollingState(e) {
|
||||||
this.isScrolling = e.target.scrollTop !== 0;
|
this.isScrolling = e.target.scrollTop !== 0;
|
||||||
},
|
},
|
||||||
|
showCuttentTime() {
|
||||||
|
this.$nextTick(() =>
|
||||||
|
this.$refs["scheduleBody"].scrollTo({
|
||||||
|
top: `${this.lineIndicatorLocation.top.slice(0, -2) - 240}`,
|
||||||
|
behavior: "smooth",
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
currentTime() {
|
currentTime() {
|
||||||
@@ -344,6 +352,7 @@ export default {
|
|||||||
this.changeCurrentTime();
|
this.changeCurrentTime();
|
||||||
this.timeCoilInitialization();
|
this.timeCoilInitialization();
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
|
this.showCuttentTime();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -351,6 +360,7 @@ export default {
|
|||||||
this.changeCurrentTime();
|
this.changeCurrentTime();
|
||||||
this.timeCoilInitialization();
|
this.timeCoilInitialization();
|
||||||
this.startTimer();
|
this.startTimer();
|
||||||
|
this.showCuttentTime();
|
||||||
},
|
},
|
||||||
beforeUnmount() {
|
beforeUnmount() {
|
||||||
this.stopTimer();
|
this.stopTimer();
|
||||||
|
|||||||
Reference in New Issue
Block a user