Update CSS styles and inline radio group component

This commit is contained in:
Dede Fuji Abdul
2023-11-02 17:05:38 +07:00
parent f58a148bd0
commit 5aae34dba0
2 changed files with 83 additions and 112 deletions

View File

@ -2,23 +2,12 @@
<div>
<fieldset>
<div class="space-y-3 sm:flex sm:items-center sm:space-y-0 sm:space-x-5">
<div
v-for="item in radioItems"
:key="item.id"
class="flex items-center"
>
<input
:id="`${item.id}`"
type="radio"
name="radio"
<div v-for="item in radioItems" :key="item.id" class="flex items-center">
<input :id="`${item.id}`" type="radio" name="radio"
:checked="item.hasOwnProperty('checked') && item.checked === true"
class="h-4 w-4 border-gray-300 text-primary-500 peer focus:ring-primary-500"
/>
<label
:for="`${item.id}`"
class="ml-3 block text-sm font-medium text-gray-700 peer-checked:text-primary-500"
>{{ item.title }}</label
>
class="w-4 h-4 border-gray-300 text-primary-500 peer focus:ring-primary-500" />
<label :for="`${item.id}`" class="block ml-3 text-sm font-medium text-gray-700 peer-checked:text-primary-500">{{
item.title }}</label>
</div>
</div>
</fieldset>
@ -26,7 +15,7 @@
</template>
<script setup lang="ts">
import { defineProps, type PropType } from 'vue'
import { type PropType } from 'vue'
interface Item {
id: number;