Сделала BaseCalendar
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user