dropdown, href is content
This commit is contained in:
parent
a904773bab
commit
f398ebb02d
5 changed files with 20 additions and 20 deletions
16
template/components/content_dropdown.html
Normal file
16
template/components/content_dropdown.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{{define "content_dropdown_item"}}
|
||||
<li><a class="dropdown-item {{if eq .IsActive true}}active{{end}} {{if eq .IsDisabled true}}disabled{{end}}" href="{{.Link}}">{{.Text}}</a></li>
|
||||
{{end}}
|
||||
|
||||
{{define "content_dropdown"}}
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-{{.TypeClass}} dropdown-toggle {{if eq .IsDisabled true}}disabled{{end}}" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
{{.Label}}
|
||||
</button>
|
||||
<ul class="dropdown-menu">
|
||||
{{ range .Items}}
|
||||
{{template "content_dropdown_item" .}}
|
||||
{{end}}
|
||||
</ul>
|
||||
</div>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue