Skip to content

Commit 6274ae9

Browse files
committed
fix: supply resource and adminUser props for custom components set it column.componetns.edit/column.components.create
1 parent 42e61d3 commit 6274ae9

File tree

1 file changed

+22
-11
lines changed

1 file changed

+22
-11
lines changed

adminforth/spa/src/components/ColumnValueInput.vue

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
@update:value="$emit('update:modelValue', $event)"
99
:meta="column.components[props.source].meta"
1010
:record="currentValues"
11+
:resource="coreStore.resource"
12+
:adminUser="coreStore.adminUser"
1113
@update:inValidity="$emit('update:inValidity', $event)"
1214
@update:emptiness="$emit('update:emptiness', $event)"
1315
/>
@@ -135,20 +137,29 @@
135137
import { ref } from 'vue';
136138
import { getCustomComponent } from '@/utils';
137139
import { useI18n } from 'vue-i18n';
140+
import { useCoreStore } from '@/stores/core';
141+
142+
const coreStore = useCoreStore();
138143
139144
const { t } = useI18n();
140145
141-
const props = defineProps<{
142-
source: 'create' | 'edit',
143-
column: any,
144-
type: string,
145-
value: any,
146-
currentValues: any,
147-
mode: string,
148-
columnOptions: any,
149-
unmasked: any,
150-
deletable: boolean,
151-
}>();
146+
const props = withDefaults(
147+
defineProps<{
148+
source: 'create' | 'edit',
149+
column: any,
150+
type?: string,
151+
value: any,
152+
currentValues: any,
153+
mode: string,
154+
columnOptions: any,
155+
unmasked: any,
156+
deletable?: boolean,
157+
}>(),
158+
{
159+
type: undefined,
160+
deletable: false,
161+
}
162+
);
152163
153164
const input = ref(null);
154165

0 commit comments

Comments
 (0)