Skip to content

Commit e926a8a

Browse files
committed
Fixed checkbox reactivity
1 parent 0e43e36 commit e926a8a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

resources/views/create-form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@elseif($col['type'] === 'boolean') @php $hasCheckbox = true;echo "\r"; @endphp
4545
<div class=" sm:col-span-4">
4646
<jet-label for="{{$col['name']}}" value="{{$col['label']}}" />
47-
<jet-checkbox class="p-2" type="checkbox" id="{{$col['name']}}" name="{{$col['name']}}" v-model="form.{{$col['name']}}"
47+
<jet-checkbox class="p-2" type="checkbox" id="{{$col['name']}}" name="{{$col['name']}}" :checked="form.{{$col['name']}}" v-model="form.{{$col['name']}}"
4848
:class="{'border-red-500 sm:focus:border-red-300 sm:focus:ring-red-100': form.errors.{{$col['name']}}}"
4949
></jet-checkbox>
5050
<jet-input-error :message="form.errors.{{$col['name']}}" class="mt-2" />

resources/views/edit-form.blade.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
@elseif($col['type'] === 'boolean')@php $hasCheckbox = true; echo "\r"; @endphp
4545
<div class=" sm:col-span-4">
4646
<jet-label for="{{$col['name']}}" value="{{$col['label']}}" />
47-
<jet-checkbox class="p-2" type="checkbox" id="{{$col['name']}}" name="{{$col['name']}}" v-model="form.{{$col['name']}}"
47+
<jet-checkbox class="p-2" type="checkbox" id="{{$col['name']}}" name="{{$col['name']}}" :checked="form.{{$col['name']}}" v-model="form.{{$col['name']}}"
4848
:class="{'border-red-500 sm:focus:border-red-300 sm:focus:ring-red-100': form.errors.{{$col['name']}}}"
4949
></jet-checkbox>
5050
<jet-input-error :message="form.errors.{{$col['name']}}" class="mt-2" />

0 commit comments

Comments
 (0)