mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-06-15 01:09:20 +08:00
24 lines
514 B
Vue
24 lines
514 B
Vue
<template>
|
|
<component :is="uiComponent.component" v-bind="uiProps">
|
|
<template #label>
|
|
<slot name="label"></slot>
|
|
</template>
|
|
<slot></slot>
|
|
</component>
|
|
</template>
|
|
|
|
<script setup lang="ts" name="TMFormItem">
|
|
import { computed } from 'vue';
|
|
|
|
import { getConfig } from './config';
|
|
const props = defineProps<{
|
|
prop?: string;
|
|
labelWidth?: string;
|
|
rules?: any;
|
|
}>();
|
|
|
|
const uiComponent = getConfig('components').formItem;
|
|
|
|
const uiProps = computed(() => uiComponent.props(props));
|
|
</script>
|