mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-26 04:09:21 +08:00
28 lines
622 B
Vue
28 lines
622 B
Vue
<template>
|
|
<component class="tmagic-design-form-item" :is="uiComponent" v-bind="uiProps">
|
|
<template #label>
|
|
<slot name="label"></slot>
|
|
</template>
|
|
<slot></slot>
|
|
</component>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { computed } from 'vue';
|
|
|
|
import { getDesignConfig } from './config';
|
|
import type { FormItemProps } from './types';
|
|
|
|
defineOptions({
|
|
name: 'TMFormItem',
|
|
});
|
|
|
|
const props = defineProps<FormItemProps>();
|
|
|
|
const ui = getDesignConfig('components')?.formItem;
|
|
|
|
const uiComponent = ui?.component || 'el-form-item';
|
|
|
|
const uiProps = computed(() => ui?.props(props) || props);
|
|
</script>
|