Skip to content

Commit bd25f86

Browse files
committed
chore: 优化Form表单Display组件
1 parent 8e979fd commit bd25f86

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const (
2222
AppName = "QuarkGo"
2323

2424
// 版本号
25-
Version = "3.8.4"
25+
Version = "3.8.5"
2626

2727
// 包名
2828
PkgName = "github.com/quarkcloudio/quark-go/v3"

template/admin/component/form/fields/display/display.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ type Component struct {
1919
RowProps map[string]interface{} `json:"rowProps,omitempty"` // 开启 grid 模式时传递给 Row, 仅在ProFormGroup, ProFormList, ProFormFieldSet 中有效,默认:{ gutter: 8 }
2020
ColProps map[string]interface{} `json:"colProps,omitempty"` // 开启 grid 模式时传递给 Col,默认:{ xs: 24 }
2121
Secondary bool `json:"secondary,omitempty"` // 是否是次要控件,只针对 LightFilter 下有效
22-
Colon bool `json:"colon,omitempty"` // 配合 label 属性使用,表示是否显示 label 后面的冒号
22+
Colon bool `json:"colon"` // 配合 label 属性使用,表示是否显示 label 后面的冒号
2323
Extra string `json:"extra,omitempty"` // 额外的提示信息,和 help 类似,当需要错误信息和提示文案同时出现时,可以使用这个。
2424
HasFeedback bool `json:"hasFeedback,omitempty"` // 配合 validateStatus 属性使用,展示校验状态图标,建议只配合 Input 组件使用
2525
Help string `json:"help,omitempty"` // 提示信息,如不设置,则会根据校验规则自动生成

template/admin/resource/resource_field.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,20 @@ func (p *Field) File(params ...interface{}) *file.Component {
234234

235235
// 文本展示组件
236236
//
237-
// field.Display("文本")
238-
func (p *Field) Display(label string) *display.Component {
239-
field := display.
240-
New().
241-
SetLabel(label)
242-
237+
// field.Display("文本内容${name}") 或 field.Display("文本标题" ,"文本内容${name}")
238+
func (p *Field) Display(params ...string) *display.Component {
239+
field := display.New()
240+
if len(params) == 1 {
241+
field.
242+
SetLabel(" ").
243+
SetValue(params[0]).
244+
SetColon(false)
245+
}
246+
if len(params) == 2 {
247+
field.
248+
SetLabel(params[0]).
249+
SetValue(params[1])
250+
}
243251
return field
244252
}
245253

web/app/admin/771.async.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)