Documentation
¶
Index ¶
- type ITreeNode
- type TreeListItem
- type TreeNode
- func (n *TreeNode) AddChild(val *TreeNode)
- func (n *TreeNode) CreateChildId(child string) string
- func (n *TreeNode) Find(f func(node *TreeNode) bool) []*TreeNode
- func (n *TreeNode) FindById(id string) *TreeNode
- func (n *TreeNode) FindOne(f func(node *TreeNode) bool) *TreeNode
- func (n *TreeNode) GetChildById(id string) *TreeNode
- func (n *TreeNode) ToRoot() *TreeRoot
- func (n *TreeNode) Walk(f func(node *TreeNode) bool)
- type TreeRoot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TreeListItem ¶
type TreeNode ¶
type TreeNode struct { // 编号 Id string /** * 父节点 */ Parent interface{} /** * 标题 */ Title string /** * 图标 */ Icon string /** * 自定义数据 */ Data interface{} /** * 子节点 */ Children []*TreeNode }
func (*TreeNode) CreateChildId ¶
func (*TreeNode) GetChildById ¶
type TreeRoot ¶
type TreeRoot struct {
TreeNode
}
func NewByList ¶
func NewByList(arr []*TreeListItem) *TreeRoot
func NewTreeRoot ¶
func NewTreeRoot() (obj *TreeRoot)
Click to show internal directories.
Click to hide internal directories.