diff --git a/template/components/tabs.go b/template/components/tabs.go index 170b019b8..49f83a16e 100644 --- a/template/components/tabs.go +++ b/template/components/tabs.go @@ -4,10 +4,12 @@ import ( "html/template" "github.com/GoAdminGroup/go-admin/template/types" + "github.com/google/uuid" ) type TabsAttribute struct { Name string + Id string Data []map[string]template.HTML types.Attribute } @@ -18,5 +20,8 @@ func (compo *TabsAttribute) SetData(value []map[string]template.HTML) types.Tabs } func (compo *TabsAttribute) GetContent() template.HTML { + if compo.Id == "" { + compo.Id = uuid.New().String()[:8] + } return ComposeHtml(compo.TemplateList, compo.Separation, *compo, "tabs") }