types

package
v2.0.36 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 2 Imported by: 21

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArcoDesignTree

type ArcoDesignTree struct {
	Items []*ArcoDesignTreeNode `json:"items"`
}

func NewArcoDesignTree

func NewArcoDesignTree() *ArcoDesignTree

func (*ArcoDesignTree) Add

func (s *ArcoDesignTree) Add(item *ArcoDesignTreeNode)

func (*ArcoDesignTree) ForEatch

func (s *ArcoDesignTree) ForEatch(fn func(*ArcoDesignTreeNode))

func (*ArcoDesignTree) GetOrCreateTreeByRootKey

func (s *ArcoDesignTree) GetOrCreateTreeByRootKey(
	key, title, nodeType string) *ArcoDesignTreeNode

type ArcoDesignTreeNode

type ArcoDesignTreeNode struct {
	// 该节点显示的标题
	Title string `json:"title"`
	// 唯一标示
	Key string `json:"key"`
	// 是否禁用节点
	Disabled bool `json:"disabled"`
	// 是否展示
	IsShow bool `json:"is_show"`
	// 是否是叶子节点。动态加载时有效
	IsLeaf bool `json:"is_leaf"`
	// 节点类型
	Type string `json:"type"`
	// 其他扩展属性
	Extra map[string]string `json:"extra"`
	// 其他扩展属性
	Labels map[string]string `json:"label"`
	// 子节点
	Children []*ArcoDesignTreeNode `json:"children"`
}

https://arco.design/vue/component/tree#API

func NewArcoDesignTreeNode

func NewArcoDesignTreeNode(key, title, nodeType string) *ArcoDesignTreeNode

func (*ArcoDesignTreeNode) Add

func (t *ArcoDesignTreeNode) Add(item *ArcoDesignTreeNode)

func (*ArcoDesignTreeNode) GetOrCreateChildrenByKey

func (t *ArcoDesignTreeNode) GetOrCreateChildrenByKey(
	key, title, nodeType string) *ArcoDesignTreeNode

func (*ArcoDesignTreeNode) SetTitle

func (t *ArcoDesignTreeNode) SetTitle(title string)

func (*ArcoDesignTreeNode) Walk

func (t *ArcoDesignTreeNode) Walk(fn func(*ArcoDesignTreeNode))

type ItemFilterFunc

type ItemFilterFunc[T any] func(t T) bool

type ItemHandleFunc

type ItemHandleFunc[T any] func(t T)

type ItemMapFunc added in v2.0.28

type ItemMapFunc[T any] func(t T) T

type Set

type Set[T any] struct {
	Total int64 `json:"total"`
	Items []T   `json:"items"`
}

func New

func New[T any]() *Set[T]

构造函数

func (*Set[T]) Add

func (s *Set[T]) Add(items ...T) *Set[T]

func (*Set[T]) Filter

func (s *Set[T]) Filter(f ItemFilterFunc[T]) *Set[T]

func (*Set[T]) ForEach

func (s *Set[T]) ForEach(h ItemHandleFunc[T])

func (*Set[T]) Len

func (s *Set[T]) Len() int

func (*Set[T]) Map added in v2.0.28

func (s *Set[T]) Map(m ItemMapFunc[T]) *Set[T]

func (*Set[T]) String

func (s *Set[T]) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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