fix: fixed some style issues (#4379)

This commit is contained in:
Vben
2024-09-12 22:03:58 +08:00
committed by GitHub
parent 537a4b0ecb
commit 76a879d4d8
27 changed files with 160 additions and 66 deletions

View File

@@ -19,7 +19,12 @@ const router = createRouter({
: createWebHistory(import.meta.env.VITE_BASE),
// 应该添加到路由的初始路由列表。
routes,
scrollBehavior: () => ({ left: 0, top: 0 }),
scrollBehavior: (to, _from, savedPosition) => {
if (savedPosition) {
return savedPosition;
}
return to.hash ? { behavior: 'smooth', el: to.hash } : { left: 0, top: 0 };
},
// 是否应该禁止尾部斜杠。
// strict: true,
});

View File

@@ -14,7 +14,7 @@ const [BaseForm] = useVbenForm({
componentProps: {
class: 'w-full',
},
labelWidth: 200,
labelClass: 'w-2/6',
},
// 使用 tailwindcss grid布局
// 提交函数

View File

@@ -210,7 +210,6 @@ function onSubmit(values: Record<string, any>) {
function handleDelete() {
formApi.setState((prev) => {
return {
...prev,
schema: prev.schema?.filter((item) => item.fieldName !== 'field7'),
};
});
@@ -219,7 +218,6 @@ function handleDelete() {
function handleAdd() {
formApi.setState((prev) => {
return {
...prev,
schema: [
...(prev?.schema ?? []),
{
@@ -235,7 +233,6 @@ function handleAdd() {
function handleUpdate() {
formApi.setState((prev) => {
return {
...prev,
schema: prev.schema?.map((item) => {
if (item.fieldName === 'field3') {
return {