File size: 1,172 Bytes
530729e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
package components
import (
"html/template"
"github.com/GoAdminGroup/go-admin/modules/menu"
"github.com/GoAdminGroup/go-admin/template/types"
)
type TreeAttribute struct {
Name string
Tree []menu.Item
EditUrl string
DeleteUrl string
UrlPrefix string
OrderUrl string
types.Attribute
}
func (compo *TreeAttribute) SetTree(value []menu.Item) types.TreeAttribute {
compo.Tree = value
return compo
}
func (compo *TreeAttribute) SetEditUrl(value string) types.TreeAttribute {
compo.EditUrl = value
return compo
}
func (compo *TreeAttribute) SetUrlPrefix(value string) types.TreeAttribute {
compo.UrlPrefix = value
return compo
}
func (compo *TreeAttribute) SetDeleteUrl(value string) types.TreeAttribute {
compo.DeleteUrl = value
return compo
}
func (compo *TreeAttribute) SetOrderUrl(value string) types.TreeAttribute {
compo.OrderUrl = value
return compo
}
func (compo *TreeAttribute) GetContent() template.HTML {
return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "tree")
}
func (compo *TreeAttribute) GetTreeHeader() template.HTML {
return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "tree-header")
}
|