[WIP] Фикс радио инпута

This commit is contained in:
megavrilinvv
2023-01-19 12:33:02 +03:00
parent 23bedea7cc
commit e0831f521f
3 changed files with 17 additions and 36 deletions

View File

@@ -3,7 +3,6 @@
q-input(
v-model="value",
:class="{'circle': circle}",
:input-style="{ color: textColor, width: width + 'px' }",
:borderless="borderless",
:placeholder="placeholder",

View File

@@ -1,20 +1,17 @@
<template lang="pug">
.container.flex.flex-col.gap-y-2
.container.flex.flex-col.gap-y-2(@click="click")
base-input-container(
v-if="radioButtonsLabel",
:label="radioButtonsLabel"
)
q-option-group(
q-option-group.flex(
class="q-gutter-md",
:style="{ columnGap: columnGap + 'px', rowGap: rowGap + 'px' }"
:size="size",
:options="items"
:options="items",
type="radio",
:id="item?.id",
:value="item?.value",
v-model="value",
:inline="inline"
)
span {{item?.label}}
</template>
<script>
@@ -32,8 +29,8 @@ export default {
default: () => [],
},
directionColumn: Boolean,
columnGap: String,
rowGap: String,
columnGap: Number,
rowGap: Number,
size: {
type: String,
default: "sm",
@@ -52,25 +49,10 @@ export default {
this.$emit("update:modelValue", value);
},
},
radioGroupClasses() {
if (this.directionColumn) {
return this.columnGap
? {
"flex-col": true,
[this.columnGap]: true,
}
: {
"flex-col": true,
"gap-y-1": true,
};
}
if (this.rowGap)
return {
[this.rowGap]: true,
};
return {
"gap-x-4": true,
};
},
methods: {
click() {
console.log(this.modelValue);
},
},
};

View File

@@ -4,7 +4,7 @@
base-radio-buttons-group(
:items="policiesList",
v-model="policy",
rowGap="gap-x-[182px]",
:columnGap="152",
inline
)
.flex.gap-x-4