Добавила скролл по условию

This commit is contained in:
Daria Golova
2022-10-20 19:26:51 +03:00
parent e6335c09b4
commit f08cc48415
2 changed files with 9 additions and 2 deletions

View File

@@ -32,7 +32,6 @@ export default {
"Захарова А.О.", "Захарова А.О.",
"Константинопольская Ю.В.", "Константинопольская Ю.В.",
"Коломойцев И.К.", "Коломойцев И.К.",
"Зайцев В.С.",
], ],
}, },
}; };

View File

@@ -1,6 +1,7 @@
<template lang="pug"> <template lang="pug">
.calendar-background-wrapper.flex.flex-col( .calendar-background-wrapper.flex.flex-col(
ref="backgroundWrapper" ref="backgroundWrapper"
:class="addScroll"
) )
calendar-column( calendar-column(
v-for="(owner, index) in columnInformation.owners" v-for="(owner, index) in columnInformation.owners"
@@ -54,6 +55,11 @@ export default {
backgroundHeight() { backgroundHeight() {
return (this.hoursArray.length - 1) * this.pixelsPerHour + 48; return (this.hoursArray.length - 1) * this.pixelsPerHour + 48;
}, },
addScroll() {
return {
scroll: this.ownersArrayLength > 3,
};
},
}, },
methods: { methods: {
calculateColumnPosition(elemIndex) { calculateColumnPosition(elemIndex) {
@@ -82,10 +88,12 @@ export default {
</script> </script>
<style lang="sass" scoped> <style lang="sass" scoped>
.scroll
overflow-x: scroll
.calendar-background-wrapper .calendar-background-wrapper
width: 100% width: 100%
position: relative position: relative
overflow-x: scroll
.header .header
height: 48px height: 48px