;
export interface FormItemDependencies {
@@ -147,6 +150,7 @@ type ComponentProps =
export interface FormCommonConfig {
/**
* 是否可折叠的
+ * @default false
*/
collapsible?: boolean;
/**
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params-item.vue b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params-item.vue
index 11a33e535..85b019718 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params-item.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params-item.vue
@@ -49,6 +49,27 @@ const FieldComponent = computed(() => {
}
});
+const limitDisplay = computed(() => {
+ if (
+ props.data.option.min !== null &&
+ props.data.option.min !== undefined &&
+ props.data.option.max !== null &&
+ props.data.option.max !== undefined
+ ) {
+ return `[${props.data.option.min},${props.data.option.max}]`;
+ }
+
+ if (props.data.option.min !== null && props.data.option.min !== undefined) {
+ return `min:${props.data.option.min}`;
+ }
+
+ if (props.data.option.max !== null && props.data.option.max !== undefined) {
+ return `max:${props.data.option.max}`;
+ }
+
+ return '';
+});
+
function reset() {
modelValue.value = props.data.defaultValue;
}
@@ -78,8 +99,8 @@ defineExpose({
/>
-
- [{{ data.option.min }},{{ data.option.max }}]
+
+ {{ limitDisplay }}
step:{{ data.option.step }}
diff --git a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue
index f4ed5d4e4..1389c606f 100644
--- a/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue
+++ b/packages/@core/ui-kit/shadcn-ui/src/components/collapsible/collapsible-params.vue
@@ -1,4 +1,6 @@
diff --git a/playground/src/locales/langs/en-US/examples.json b/playground/src/locales/langs/en-US/examples.json
index 00ff67ab9..9f88ebd37 100644
--- a/playground/src/locales/langs/en-US/examples.json
+++ b/playground/src/locales/langs/en-US/examples.json
@@ -26,7 +26,7 @@
"file": "file",
"crop-image": "Crop image",
"upload-image": "Click to upload image",
- "collapsible": "Collapsible FormItem Content"
+ "collapsible": "Collapsible Form Field"
},
"vxeTable": {
"title": "Vxe Table",
diff --git a/playground/src/views/examples/form/collapsible.vue b/playground/src/views/examples/form/collapsible.vue
index bdd70dfa9..488d80ab7 100644
--- a/playground/src/views/examples/form/collapsible.vue
+++ b/playground/src/views/examples/form/collapsible.vue
@@ -1,4 +1,6 @@
@@ -201,10 +287,16 @@ function onLayoutChange(layout: string) {
option-type="button"
v-model:value="layout"
@update:value="onLayoutChange"
- >
+ />
+
+
+ 提交表单
+
+
+ 重置表单
+