adrema/resources/js/views/formtemplate/useElements.js

16 lines
368 B
JavaScript
Raw Permalink Normal View History

2024-04-11 23:01:52 +02:00
export default function useElements() {
function addOption(options) {
return [...options, ''];
}
function setOption(options, index, $event) {
return options.toSpliced(index, 1, $event);
}
function removeOption(options, index) {
return options.toSpliced(index, 1);
}
return {addOption, setOption, removeOption};
}