change whole backend and tables for gorm table references
simplify tables with table components close #31
This commit is contained in:
@@ -44,7 +44,7 @@ const props = defineProps({
|
||||
required: true,
|
||||
},
|
||||
optionLabel: {
|
||||
type: [Function, String] as PropType<((option: T) => string) | string>,
|
||||
type: [Function, String] as PropType<((option: T) => string) | string | undefined>,
|
||||
required: true,
|
||||
},
|
||||
optionValue: {
|
||||
@@ -61,7 +61,7 @@ const optionLabel = props.optionLabel;
|
||||
const optionValue = props.optionValue;
|
||||
|
||||
const modelValueLocal = ref<string | number | object | null | undefined>(props.modelValue);
|
||||
const filteredOptions = ref<T[]>([...props.options]);
|
||||
const filteredOptions = ref<T[]>([...(props.options || [])]);
|
||||
|
||||
function searchBox() {
|
||||
if (search.value) {
|
||||
@@ -91,7 +91,7 @@ function filterFn(val: string, update: (fn: () => void) => void) {
|
||||
if (typeof optionLabel === 'function') {
|
||||
field = optionLabel(opt);
|
||||
} else {
|
||||
field = opt[optionLabel];
|
||||
field = opt[String(optionLabel)];
|
||||
}
|
||||
|
||||
if (typeof field !== 'string' && typeof field !== 'number') return false;
|
||||
|
||||
Reference in New Issue
Block a user