Documentation
¶
Overview ¶
Package table 为 Bubble Tea 应用程序提供一个简单的表格组件。
Index ¶
- type Column
- type KeyMap
- type Model
- func (m *Model) Blur()
- func (m Model) Columns() []Column
- func (m Model) Cursor() int
- func (m *Model) Focus()
- func (m Model) Focused() bool
- func (m *Model) FromValues(value, separator string)
- func (m *Model) GotoBottom()
- func (m *Model) GotoTop()
- func (m Model) Height() int
- func (m Model) HelpView() string
- func (m *Model) MoveDown(n int)
- func (m *Model) MoveUp(n int)
- func (m Model) Rows() []Row
- func (m Model) SelectedRow() Row
- func (m *Model) SetColumns(c []Column)
- func (m *Model) SetCursor(n int)
- func (m *Model) SetHeight(h int)
- func (m *Model) SetRows(r []Row)
- func (m *Model) SetStyles(s Styles)
- func (m *Model) SetWidth(w int)
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m *Model) UpdateViewport()
- func (m Model) View() string
- func (m Model) Width() int
- type Option
- type Row
- type Styles
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KeyMap ¶
type KeyMap struct {
LineUp key.Binding // 向上移动一行
LineDown key.Binding // 向下移动一行
PageUp key.Binding // 向上翻页
PageDown key.Binding // 向下翻页
HalfPageUp key.Binding // 向上翻半页
HalfPageDown key.Binding // 向下翻半页
GotoTop key.Binding // 跳转到顶部
GotoBottom key.Binding // 跳转到底部
}
KeyMap 定义键绑定。它满足 help.KeyMap 接口, 该接口用于渲染帮助菜单。
type Model ¶
type Model struct {
KeyMap KeyMap // 键位映射
Help help.Model // 帮助模型
// contains filtered or unexported fields
}
Model 定义表格小部件的状态。
func (*Model) FromValues ¶
FromValues 从简单字符串创建表格行。默认情况下,它使用 `\n` 来获取所有行,并使用给定的分隔符来分隔每行的字段。
Click to show internal directories.
Click to hide internal directories.