vuestic-ui
Version:
Vue 3 UI Framework
27 lines (26 loc) • 631 B
JavaScript
const useMaxSelectionsProps = {
maxSelections: {
type: [Number, String],
default: void 0
}
};
function useMaxSelections(selections, maxSelections) {
const exceedsMaxSelections = () => {
if (maxSelections.value === void 0 || isNaN(+maxSelections.value)) {
return false;
}
return selections.value.length >= Number(maxSelections.value);
};
const addOption = (optionToAdd) => {
return [...selections.value, optionToAdd];
};
return {
exceedsMaxSelections,
addOption
};
}
export {
useMaxSelections as a,
useMaxSelectionsProps as u
};
//# sourceMappingURL=useMaxSelections.js.map