feat: 增加 useVbenForm 样式,去掉data.ts 中 字段class

This commit is contained in:
xingyu4j
2025-04-27 14:59:53 +08:00
parent 2a805f560f
commit 1c2da07ded
37 changed files with 168 additions and 93 deletions

View File

@@ -44,7 +44,6 @@ export function useFormSchema(): VbenFormSchema[] {
} as SystemMenuApi.Menu);
return handleTree(data);
},
class: 'w-full',
labelField: 'name',
valueField: 'id',
childrenField: 'children',
@@ -203,7 +202,6 @@ export function useFormSchema(): VbenFormSchema[] {
component: 'InputNumber',
componentProps: {
min: 0,
class: 'w-full',
controlsPosition: 'right',
placeholder: '请输入显示顺序',
},

View File

@@ -22,6 +22,13 @@ const getTitle = computed(() =>
);
const [Form, formApi] = useVbenForm({
commonConfig: {
componentProps: {
class: 'w-full',
},
formItemClass: 'col-span-2',
labelWidth: 100,
},
layout: 'horizontal',
schema: useFormSchema(),
showDefaultActions: false,
@@ -75,7 +82,7 @@ const [Modal, modalApi] = useVbenModal({
</script>
<template>
<Modal :title="getTitle">
<Modal class="w-[40%]" :title="getTitle">
<Form class="mx-4" />
</Modal>
</template>