Сделала BaseCalendar

This commit is contained in:
Daria Golova
2023-06-21 16:32:25 +03:00
parent 1915538ca2
commit 16b5762883
3 changed files with 37 additions and 66 deletions

View File

@@ -28,11 +28,6 @@ export default {
endYear: Number,
internalMonth: String,
},
data() {
return {
previousDate: null,
};
},
computed: {
internalValue: {
get() {
@@ -69,9 +64,14 @@ export default {
selectYear(year) {
this.internalValue = this.internalValue.clone().year(year);
},
scrollToCurrentYear() {
document
.getElementById(parseInt(this.internalValue.format("YYYY"), 10))
.scrollIntoView({ block: "center", behavior: "smooth" });
},
},
mounted() {
this.previousDate = this.internalValue.clone();
this.scrollToCurrentYear();
},
};
</script>