utils

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: MIT, MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetSubMenu

func SetSubMenu(action actions.ActionWrapper, menu *MenuGroup)

设置子菜单

func SetTabbar

func SetTabbar(action actions.ActionWrapper, tabbar *Tabbar)

设置子菜单

Types

type LogWriter

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

func (*LogWriter) Close

func (this *LogWriter) Close()

func (*LogWriter) Init

func (this *LogWriter) Init()

func (*LogWriter) Write

func (this *LogWriter) Write(message string)
type Menu struct {
	Id               string      `json:"id"`
	Name             string      `json:"name"`
	Items            []*MenuItem `json:"items"`
	IsActive         bool        `json:"isActive"`
	AlwaysActive     bool        `json:"alwaysActive"`
	Index            int         `json:"index"`
	CountNormalItems int         `json:"countNormalItems"`
}

子菜单定义

func NewMenu

func NewMenu() *Menu

获取新对象

func (this *Menu) Add(name string, subName string, url string, isActive bool) *MenuItem

添加菜单项

func (this *Menu) AddSpecial(name string, subName string, url string, isActive bool) *MenuItem

添加特殊菜单项,不计数

type MenuGroup struct {
	Menus      []*Menu `json:"menus"`
	AlwaysMenu *Menu   `json:"alwaysMenu"`
}

菜单分组

func NewMenuGroup

func NewMenuGroup() *MenuGroup

获取新菜单分组对象

func (this *MenuGroup) FindMenu(menuId string, menuName string) *Menu

查找菜单,如果找不到则自动创建

func (this *MenuGroup) Sort()

排序

type MenuItem struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	SubName    string `json:"subName"` // 副标题
	SupName    string `json:"supName"` // 头标
	URL        string `json:"url"`
	IsActive   bool   `json:"isActive"`
	Icon       string `json:"icon"`
	IsSortable bool   `json:"isSortable"`
	SubColor   string `json:"subColor"`
}

菜单项

type Tabbar

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

Tabbar定义

func NewTabbar

func NewTabbar() *Tabbar

获取新对象

func (*Tabbar) Add

func (this *Tabbar) Add(name string, subName string, url string, icon string, active bool) maps.Map

添加菜单项

func (*Tabbar) Items

func (this *Tabbar) Items() []maps.Map

取得所有的Items

Jump to

Keyboard shortcuts

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