Files
manolia-alpha/node_modules/buetify/lib/composables/labelId/useLabelId.js
Robin COuret e0e50af706 init component
2026-02-16 17:28:37 +01:00

20 lines
492 B
JavaScript
Executable File

import { computed, toRef } from 'vue';
let numId = 0;
export const UseLabelIdPropsDefinition = {
labelFor: String,
label: {
type: String,
default: ''
}
};
export function useLabelId(props, prefix) {
const newId = numId++;
const id = computed(() => props.labelFor ? props.labelFor : `${prefix}-${newId}`);
const labelId = computed(() => `label-for-${id.value}`);
return {
id,
labelId,
label: toRef(props, 'label')
};
}
//# sourceMappingURL=useLabelId.js.map