fix checkbox

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-02-13 02:34:34 +01:00
parent b7ec02e5e8
commit e927c81b34
2 changed files with 7 additions and 9 deletions

View file

@ -1,20 +1,16 @@
<template>
<div class="relative mb-8">
<label class="mb-1 block w-full" :for="name">{{ label }}</label>
<input
class="border-2 border-solid border-stone-300 bg-transparent px-2 outline-none dark:border-stone-700"
:name="name"
:id="name"
type="checkbox"
:checked="checked"
@change="handleChange((checked = !checked))"
v-bind="$attrs"
/>
<div @click="handleChange(checked)">
<IconToggleOn v-if="!checked" class="h-12 w-12 fill-emerald-700" />
<IconToggleOff v-else class="h-12 w-12 cursor-pointer fill-stone-500" />
</div>
</div>
</template>
<script setup lang="ts">
import { useField } from 'vee-validate'
import { IconToggleOn, IconToggleOff } from '@/components/icons'
const props = defineProps({
value: {

View file

@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'
import { Form } from 'vee-validate'
import { object, string } from 'yup'
import { useAuth } from '@/composables'
import { IconLogin } from '@/components/icons'
import BaseButton from '@/components/BaseButton.vue'
import InputText from '@/components/InputText.vue'
@ -47,6 +48,7 @@ const onSubmit = (values: any): void => {
<BaseButton
class="h-12 w-full"
mode="primary"
:icon="IconLogin"
:disabled="!meta.dirty || !meta.valid"
>{{ t('pages.login-view.main.form.submit.text') }}</BaseButton
>