up generate

表单组件是动态键值对类型,默认值改为空数组
This commit is contained in:
maxbad
2024-01-14 16:43:19 +08:00
parent fce75433fb
commit 528d985de5

View File

@@ -47,6 +47,9 @@ func (l *gCurd) generateWebModelState(ctx context.Context, in *CurdPreviewInput)
if field.FormMode == "Switch" {
value = 2
}
if field.FormMode == "InputDynamic" {
value = "[]"
}
buffer.WriteString(fmt.Sprintf(" public %s = %v; // %s\n", field.TsName, value, field.Dc))
}
buffer.WriteString("\n constructor(state?: Partial<State>) {\n if (state) {\n Object.assign(this, state);\n }\n }")