WIP Сделала селект и кнопку сортировки

This commit is contained in:
Daria Golova
2023-04-28 13:56:51 +03:00
parent 430ac66273
commit a5acc67c10
2 changed files with 39 additions and 3 deletions

View File

@@ -1,6 +1,6 @@
<template lang="pug"> <template lang="pug">
.flex.flex-col.gap-y-2 .flex.flex-col.gap-y-2
base-input-container(:label="label") base-input-container(:label="label", :style="{width: width}")
q-select( q-select(
v-model="value", v-model="value",
:options="items", :options="items",
@@ -74,6 +74,7 @@ export default {
disable: Boolean, disable: Boolean,
label: String, label: String,
readonly: Boolean, readonly: Boolean,
width: String,
}, },
emits: ["update:modelValue"], emits: ["update:modelValue"],
data() { data() {

View File

@@ -9,8 +9,16 @@
icon="add", icon="add",
:style="{width: '100%'}" :style="{width: '100%'}"
) )
.p-4.rounded.background.h-full .p-4.rounded.background.h-full.w-full
base-select .flex.w-full
base-select(:style="{flex: 1}")
q-btn.ml-2(
icon="sort"
:style="{width: '40px', height: '40px'}",
padding="0"
:class="sortingClass"
@click="invertSorting"
)
</template> </template>
<script> <script>
@@ -18,6 +26,27 @@ import BaseSelect from "@/components/base/BaseSelect.vue";
export default { export default {
name: "MedicalProtocolsList", name: "MedicalProtocolsList",
components: { BaseSelect }, components: { BaseSelect },
data() {
return {
sorting: false,
};
},
computed: {
sortingClass() {
return this.sorting
? {
"sort-icon-active": true,
}
: {
"sort-icon-default": true,
};
},
},
methods: {
invertSorting() {
this.sorting = !this.sorting;
},
},
}; };
</script> </script>
@@ -26,4 +55,10 @@ export default {
width: 19.6% width: 19.6%
.background .background
background-color: var(--default-white) background-color: var(--default-white)
.sort-icon-default
background-color: var(--bg-light-grey)
color: var(--font-grey-color)
.sort-icon-active
background-color: var(--btn-blue-color)
color: var(--default-white)
</style> </style>