Сделала переключатель День/Неделя
This commit is contained in:
47
src/pages/calendar/components/CalendarLayoutSwitch.vue
Normal file
47
src/pages/calendar/components/CalendarLayoutSwitch.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template lang="pug">
|
||||
.layout-switch-wrapper.inline-block
|
||||
button#day.py-2.px-3(:class="dayLayoutState" @click="changeSelectedLayout") День
|
||||
button#week.py-2.px-3(:class="weekLayoutState" @click="changeSelectedLayout") Неделя
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "CalendarLayoutSwitch",
|
||||
props: {},
|
||||
data() {
|
||||
return {
|
||||
selectedLayout: "day",
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
dayLayoutState() {
|
||||
return {
|
||||
active: this.selectedLayout === "day",
|
||||
};
|
||||
},
|
||||
weekLayoutState() {
|
||||
return {
|
||||
active: this.selectedLayout === "week",
|
||||
};
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
changeSelectedLayout(event) {
|
||||
this.selectedLayout = event.target.id;
|
||||
this.$emit("selected", event.target.id);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="sass" scoped>
|
||||
.active
|
||||
background-color: #6787e7
|
||||
color: var(--bg-white-color)
|
||||
border-radius: 4px
|
||||
|
||||
.layout-switch-wrapper
|
||||
background-color: var(--bg-lavender-color)
|
||||
color: var(--font-dark-blue-color)
|
||||
border-radius: 4px
|
||||
</style>
|
||||
Reference in New Issue
Block a user