fix: class

This commit is contained in:
allen
2026-04-13 20:41:43 +08:00
parent 12a81a7a7d
commit f30157fa59
2 changed files with 14 additions and 12 deletions

View File

@@ -62,10 +62,10 @@ defineExpose({
<div
class="body-row flex items-center w-full flex-nowrap not-last-of-type:border-b"
>
<div class="pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap">
<div class="body-cell pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap">
{{ data.key }}
</div>
<div class="pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap">
<div class="body-cell pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap">
<div class="flex-auto w-full">
<component
:is="FieldComponent"
@@ -83,7 +83,7 @@ defineExpose({
</div>
</div>
<div
class="pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap w-full"
class="body-cell pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap w-full"
>
<p
class="line-clamp-2"

View File

@@ -54,14 +54,16 @@ const bodyStyle = computed(() => {
};
});
function init() {
if (!modelValue.value) {
modelValue.value = {};
}
function init(force = false) {
const nextValue = { ...(modelValue.value ?? {}) };
for (const param of props.params) {
modelValue.value[param.key] = param.defaultValue ?? null;
if (force || nextValue[param.key] === undefined) {
nextValue[param.key] = param.defaultValue ?? null;
}
}
modelValue.value = nextValue;
}
function toggleCollapsed() {
@@ -84,7 +86,7 @@ function resetValue() {
rowRef.reset();
}
init();
init(true);
}
init();
@@ -108,17 +110,17 @@ defineExpose({
class="header bg-accent w-full flex-none flex items-center rounded-t-[0.5rem] border-b"
>
<div
class="pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap"
class="header-cell pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap"
>
参数名称
</div>
<div
class="pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap"
class="header-cell pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap"
>
配置
</div>
<div
class="pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap"
class="header-cell pt-2 pb-2 px-5 leading-[1.5rem] flex items-center flex-nowrap"
>
说明
</div>