mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-06-07 05:57:41 +00:00
fix checkbox
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
b7ec02e5e8
commit
e927c81b34
2 changed files with 7 additions and 9 deletions
|
@ -1,20 +1,16 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="relative mb-8">
|
<div class="relative mb-8">
|
||||||
<label class="mb-1 block w-full" :for="name">{{ label }}</label>
|
<label class="mb-1 block w-full" :for="name">{{ label }}</label>
|
||||||
<input
|
<div @click="handleChange(checked)">
|
||||||
class="border-2 border-solid border-stone-300 bg-transparent px-2 outline-none dark:border-stone-700"
|
<IconToggleOn v-if="!checked" class="h-12 w-12 fill-emerald-700" />
|
||||||
:name="name"
|
<IconToggleOff v-else class="h-12 w-12 cursor-pointer fill-stone-500" />
|
||||||
:id="name"
|
</div>
|
||||||
type="checkbox"
|
|
||||||
:checked="checked"
|
|
||||||
@change="handleChange((checked = !checked))"
|
|
||||||
v-bind="$attrs"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useField } from 'vee-validate'
|
import { useField } from 'vee-validate'
|
||||||
|
import { IconToggleOn, IconToggleOff } from '@/components/icons'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
value: {
|
value: {
|
||||||
|
|
|
@ -4,6 +4,7 @@ import { useI18n } from 'vue-i18n'
|
||||||
import { Form } from 'vee-validate'
|
import { Form } from 'vee-validate'
|
||||||
import { object, string } from 'yup'
|
import { object, string } from 'yup'
|
||||||
import { useAuth } from '@/composables'
|
import { useAuth } from '@/composables'
|
||||||
|
import { IconLogin } from '@/components/icons'
|
||||||
import BaseButton from '@/components/BaseButton.vue'
|
import BaseButton from '@/components/BaseButton.vue'
|
||||||
import InputText from '@/components/InputText.vue'
|
import InputText from '@/components/InputText.vue'
|
||||||
|
|
||||||
|
@ -47,6 +48,7 @@ const onSubmit = (values: any): void => {
|
||||||
<BaseButton
|
<BaseButton
|
||||||
class="h-12 w-full"
|
class="h-12 w-full"
|
||||||
mode="primary"
|
mode="primary"
|
||||||
|
:icon="IconLogin"
|
||||||
:disabled="!meta.dirty || !meta.valid"
|
:disabled="!meta.dirty || !meta.valid"
|
||||||
>{{ t('pages.login-view.main.form.submit.text') }}</BaseButton
|
>{{ t('pages.login-view.main.form.submit.text') }}</BaseButton
|
||||||
>
|
>
|
||||||
|
|
Loading…
Add table
Reference in a new issue