Skip to content

A self-hosted media server and file management system

fix: passing class directly does not work on components with multiple root elements

aminnausin706beb038066
diff --git a/resources/js/components/labels/FormInputLabel.vue b/resources/js/components/labels/FormInputLabel.vue
index 4991d8ab..b4ad56df 100755
--- a/resources/js/components/labels/FormInputLabel.vue
+++ b/resources/js/components/labels/FormInputLabel.vue
@@ -1,14 +1,15 @@
<script setup lang="ts">
import type { FormField } from '@/types/types';
-defineProps<{
+const props = defineProps<{
field: FormField;
textSize?: string;
+ class?: string;
}>();
</script>
<template>
- <label :for="field?.name" :class="[`leading-none block font-medium text-gray-700 dark:text-neutral-200`, textSize ? textSize : 'text-sm']">
+ <label :for="field?.name" :class="[`leading-none block font-medium text-gray-700 dark:text-neutral-200`, textSize ? textSize : 'text-sm', `${props.class ?? ''}`]">
{{ field?.text }}
</label>
<p v-if="field?.subtext" class="text-sm/6 text-gray-500 dark:text-gray-400">{{ field.subtext }}</p>
diff --git a/resources/js/components/labels/InputLabel.vue b/resources/js/components/labels/InputLabel.vue
index 656f51c1..c4d8a952 100644
--- a/resources/js/components/labels/InputLabel.vue
+++ b/resources/js/components/labels/InputLabel.vue
@@ -1,14 +1,15 @@
<script setup lang="ts">
-defineProps<{
+const props = defineProps<{
name?: string;
text?: string;
subtext?: string;
+ class?: string;
subtextClass?: string;
}>();
</script>
<template>
- <label :for="name" :class="[`font-medium text-gray-700 dark:text-neutral-200`]">
+ <label :for="name" :class="[`font-medium text-gray-700 dark:text-neutral-200`, props.class]">
{{ text }}
</label>
<p v-if="subtext" :class="['text-sm/6 text-gray-500 dark:text-gray-400', subtextClass]">{{ subtext }}</p>