form

package
v1.0.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Form

type Form interface {
	View() string
	Update(msg tea.Msg) tea.Cmd
	Submit() (bool, string)
	GetContent() string
}

type Input

type Input struct {
	ContentText string
	// contains filtered or unexported fields
}

func NewInput

func NewInput(promptText string) *Input

初始化

func (*Input) GetContent

func (s *Input) GetContent() string

获取输入内容

func (*Input) Submit

func (s *Input) Submit() (bool, string)

提交

func (*Input) Update

func (s *Input) Update(msg tea.Msg) tea.Cmd

更新

func (Input) View

func (s Input) View() string

视图

type Selector

type Selector struct {
	// contains filtered or unexported fields
}

func NewSelector

func NewSelector(promptText string, options []SelectorItem) *Selector

初始化

func (*Selector) GetContent

func (s *Selector) GetContent() string

获取结果

func (*Selector) Submit

func (s *Selector) Submit() (bool, string)

提交

func (*Selector) Update

func (s *Selector) Update(msg tea.Msg) tea.Cmd

更新

func (Selector) View

func (s Selector) View() string

视图

type SelectorItem

type SelectorItem struct {
	Title string
	Label string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL