mirror of
https://github.com/bufanyun/hotgo.git
synced 2025-08-26 16:46:14 +08:00
fix generate
接口返回list如果是nil,则赋值为空数组 前端State类加构造函数
This commit is contained in:
@@ -46,6 +46,7 @@ func (l *gCurd) generateWebModelState(ctx context.Context, in *CurdPreviewInput)
|
||||
}
|
||||
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 }")
|
||||
buffer.WriteString("}")
|
||||
return buffer.String()
|
||||
}
|
||||
|
Reference in New Issue
Block a user