95
95
</template >
96
96
97
97
<script setup lang="ts">
98
- import type { ApiRequest , ResponseStatus , ModalProvider , InputProp } from ' @/types'
98
+ import type { MetadataType , ApiRequest , ResponseStatus , ModalProvider , InputProp } from ' @/types'
99
99
import { computed , provide , ref , getCurrentInstance , watch , onMounted , onUnmounted , nextTick } from ' vue'
100
100
import { ApiResult , HttpMethods , humanize , map , omitEmpty } from ' @servicestack/client'
101
101
import { useClient } from ' @/use/client'
@@ -111,6 +111,7 @@ const props = withDefaults(defineProps<{
111
111
showLoading? : boolean
112
112
jsconfig? : string
113
113
formStyle? : " slideOver" | " card"
114
+ metaType? : MetadataType
114
115
configureField? : (field : InputProp ) => void
115
116
configureFormLayout? : (field : InputProp []) => void
116
117
@@ -190,11 +191,11 @@ const subHeadingClass = computed(() => props.subHeadingClass || form.subHeadingC
190
191
const buttonsClass = computed (() => typeof props .buttonsClass == ' string' ? props .buttonsClass : form .buttonsClass )
191
192
192
193
const typeName = computed (() => props .type ? getTypeName (props .type ) : props .modelValue ?.[' getTypeName' ] ? props .modelValue .getTypeName () : null )
193
- const metaType = computed (() => typeOf (typeName .value ))
194
+ const metaType = computed (() => props . metaType ?? typeOf (typeName .value ))
194
195
const resolveModel = () => props .modelValue || newDto ()
195
196
const model = ref (resolveModel ())
196
197
const loading = computed (() => client .loading .value )
197
- const title = computed (() => props .heading != null ? props .heading : (typeOf ( typeName .value ) ?.description || humanize (typeName .value )))
198
+ const title = computed (() => props .heading != null ? props .heading : (metaType .value ?.description || humanize (typeName .value )))
198
199
199
200
function newDto() {
200
201
return typeof props .type == ' string' ? createDto (props .type ) : props .type ? new props .type () : props .modelValue
0 commit comments