refactor: ApiComponent with docs (#5099)

* refactor:  `ApiComponent` with docs

* docs: remove invalid docs

* docs: remove duplicate prop docs

* docs: update `ApiComponent` docs
This commit is contained in:
Netfan
2024-12-11 10:45:04 +08:00
committed by GitHub
parent 2cc918f79d
commit eec6f41f6a
11 changed files with 271 additions and 17 deletions

View File

@@ -1,7 +1,7 @@
<script lang="ts" setup>
import type { AnyPromiseFunction } from '@vben/types';
import { computed, ref, unref, useAttrs, type VNode, watch } from 'vue';
import { type Component, computed, ref, unref, useAttrs, watch } from 'vue';
import { LoaderCircle } from '@vben/icons';
import { get, isEqual, isFunction } from '@vben-core/shared/utils';
@@ -18,7 +18,7 @@ type OptionsItem = {
interface Props {
/** 组件 */
component: VNode;
component: Component;
/** 是否将value从数字转为string */
numberToString?: boolean;
/** 获取options数据的函数 */
@@ -53,7 +53,7 @@ interface Props {
modelPropName?: string;
}
defineOptions({ name: 'ApiSelect', inheritAttrs: false });
defineOptions({ name: 'ApiComponent', inheritAttrs: false });
const props = withDefaults(defineProps<Props>(), {
labelField: 'label',

View File

@@ -0,0 +1 @@
export { default as ApiComponent } from './api-component.vue';

View File

@@ -1 +0,0 @@
export { default as ApiSelect } from './api-select.vue';

View File

@@ -1,4 +1,4 @@
export * from './api-select';
export * from './api-component';
export * from './captcha';
export * from './ellipsis-text';
export * from './icon-picker';