From feeffc32b136b95550330e77ddc7a8c44a180101 Mon Sep 17 00:00:00 2001 From: aalizzwell Date: Tue, 11 Oct 2022 19:20:56 +0800 Subject: [PATCH] chore: add component basic layout & basic props --- .../combo-list/src/combo-list.component.tsx | 31 +++++++++++++++++-- .../combo-list/src/combo-list.props.ts | 19 +++++++++--- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/packages/ui-vue/components/combo-list/src/combo-list.component.tsx b/packages/ui-vue/components/combo-list/src/combo-list.component.tsx index e758afe..958cea2 100644 --- a/packages/ui-vue/components/combo-list/src/combo-list.component.tsx +++ b/packages/ui-vue/components/combo-list/src/combo-list.component.tsx @@ -1,15 +1,42 @@ -import { defineComponent, SetupContext } from 'vue'; +import { defineComponent, ref, SetupContext } from 'vue'; import { comboListProps, ComboListProps } from './combo-list.props'; import { ButtonEdit } from '../../button-edit'; +import { ViewType } from './types'; export default defineComponent({ name: 'FComboList', props: comboListProps, emits: [], setup(props: ComboListProps, context: SetupContext) { + const modelValue = ref(props.modelValue); return () => { return ( <> - + + {/** Tag展示 */} +
+
+
+
+ + + +
+
+ +
+
+
+ + + + +
+
+
+ {/** 下拉面板区域 */} +
); }; diff --git a/packages/ui-vue/components/combo-list/src/combo-list.props.ts b/packages/ui-vue/components/combo-list/src/combo-list.props.ts index 6ba9f4b..8048f50 100644 --- a/packages/ui-vue/components/combo-list/src/combo-list.props.ts +++ b/packages/ui-vue/components/combo-list/src/combo-list.props.ts @@ -69,7 +69,7 @@ export const comboListProps = { * 可选,是否支持多选 * 默认`false` */ - multiSelect: Type({default: false, type: Boolean}), + multiSelect: Type({ default: false, type: Boolean }), /** * 数据源地址 */ @@ -78,22 +78,31 @@ export const comboListProps = { * 可选,最大高度 * 默认`200` */ - maxHeight: Type({default: 200, type: Number}), + maxHeight: Type({ default: 200, type: Number }), /** * 可选,是否支持远端过滤 * 默认`false` */ - remoteSearch: Type({default: false, type: Boolean}), + remoteSearch: Type({ default: false, type: Boolean }), /** * 可选,清空值时隐藏面板 * 默认`true` */ - hidePanelOnClear: Type({default: true, type: Boolean}), + hidePanelOnClear: Type({ default: true, type: Boolean }), /** * 可选,分隔符 * 默认`,` */ - separator: Type({default: ',', type: String}), + separator: Type({ default: ',', type: String }), + /** + * 可选,展示文本 + * 默认为空字符串 + */ + displayText: Type({ type: String, default: '' }), + /** + * 绑定值 + */ + modelValue: Type(String) }; export type ComboListProps = ExtractPropTypes; \ No newline at end of file