- Ricerca Titolo per nome o autore o ISBN o codice articolo

This commit is contained in:
Surya Paolo
2025-03-31 23:55:53 +02:00
parent 7624f16723
commit 61c1dc3d0d
67 changed files with 760 additions and 1618 deletions

View File

@@ -761,6 +761,31 @@ export default defineComponent({
// Seleziona tutto il testo all'interno della casella di testo
event.target.select();
}
function getLabelValue(opt: any): string {
const collabel = props.optlab
if (typeof collabel === 'function') {
// Se collabel è una funzione, chiamala con opt
return collabel(opt)
} else if (typeof collabel === 'string') {
// Se collabel è una stringa, usa il valore della proprietà corrispondente
return opt[collabel] || 'N/A'
}
// Fallback generico
return 'N/A';
}
function getOptionLabel(option: any): string {
console.log('getOptionLabel', option)
if (typeof props.optlab === 'function') {
return props.optlab(option); // Se optlab è una funzione, chiamala
} else {
return option[props.optlab]; // Se optlab è una stringa, usa la proprietà corrispondente
}
}
onMounted(mounted)
@@ -777,6 +802,8 @@ export default defineComponent({
getIcon,
tools,
selectText,
getLabelValue,
getOptionLabel,
}
}
})

View File

@@ -93,8 +93,7 @@
:input-class="myclass"
:options="valori"
:option-value="optval"
:option-label="optlab"
map-options
:option-label="getOptionLabel"
:use-chips="myvalue && myvalue !== '' ? true : false"
stack-label
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
@@ -125,7 +124,8 @@
<q-item v-bind="scope.itemProps">
<q-item-section>
<q-item-label>
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}</q-item-label
{{ tools.getValueByFunzOrVal(scope.opt, optlab) }}
</q-item-label
>
</q-item-section>
</q-item>