Skip to content

Commit

Permalink
fix: ComponentStaticPicker
Browse files Browse the repository at this point in the history
  • Loading branch information
chyroc committed Apr 30, 2024
1 parent fcdfd68 commit b44515a
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions card/v2/component_interactive_static_picker.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ type ComponentStaticPicker struct {
// false: 单选组件组件保持可用状态
Disabled bool `json:"disabled,omitempty"`

// 下拉选择组件的初始选项值。取值上限为选项的数量。该配置将会覆盖 placeholder 配置的占位文本。
InitialIndex int64 `json:"initial_index,omitempty"`
// 下拉选择组件的初始选项值,取值为选项 StaticPickerOption.Value
InitialOption string `json:"initial_option,omitempty"`

// 下拉选择组件内的占位文本。
Placeholder *ObjectText `json:"placeholder,omitempty"`
Expand Down Expand Up @@ -133,9 +133,9 @@ func (r *ComponentStaticPicker) SetDisabled(val bool) *ComponentStaticPicker {
return r
}

// SetInitialIndex set ComponentStaticPicker.InitialIndex attribute
func (r *ComponentStaticPicker) SetInitialIndex(val int64) *ComponentStaticPicker {
r.InitialIndex = val
// SetInitialOption set ComponentStaticPicker.InitialOption attribute
func (r *ComponentStaticPicker) SetInitialOption(val string) *ComponentStaticPicker {
r.InitialOption = val
return r
}

Expand Down Expand Up @@ -208,8 +208,8 @@ func (r *ComponentStaticPicker) toMap() map[string]interface{} {
if r.Disabled != false {
res["disabled"] = r.Disabled
}
if r.InitialIndex != 0 {
res["initial_index"] = r.InitialIndex
if r.InitialOption != "" {
res["initial_option"] = r.InitialOption
}
if r.Placeholder != nil {
res["placeholder"] = r.Placeholder
Expand Down

0 comments on commit b44515a

Please sign in to comment.