package alpine
import "hauru.club/x/okrzeja/web/view/alpine"
Package alpine implements HTML gomponents attributes for alpinejs, lightweight JavaScript framework.
Index ¶
- func Bind(value ...string) g.Node
- func BindAttr(attr, expr string) g.Node
- func Data(value ...string) g.Node
- func For(item, index, items string) g.Node
- func ID(ids ...string) g.Node
- func Model(expr string) g.Node
- func On(event, expr string) g.Node
- func Ref(expr string) g.Node
- func Show(expr string) g.Node
- func Text(expr string) g.Node
Functions ¶
func Bind ¶
Bind allows you to bind an object of different directives and attributes to an element.
See: https://alpinejs.dev/directives/bind#bind-directives for official documentation.
func BindAttr ¶
BindAttr allows you to set HTML attributes on elements based on the result of JavaScript expressions.
See: https://alpinejs.dev/directives/bind for official documentation.
func Data ¶
Data defines a chunk of HTML as an Alpine component and provides the reactive data for that component to reference.
See: https://alpinejs.dev/directives/data for official documentation.
func For ¶
For directive allows you to create DOM elements by iterating through a list.
See: https://alpinejs.dev/directives/for for official documentation.
func ID ¶
ID allows you to declare a new "scope" for any new IDs generated using $id(). It accepts an array of strings (ID names) and adds a suffix to each $id('...') generated within it that is unique to other IDs on the page.
See: https://alpinejs.dev/directives/id for official documentation.
func Model ¶
Model allows you to bind the value of an input element to Alpine data.
See: https://alpinejs.dev/directives/model for official documentation.
func On ¶
On allows you to easily run code on dispatched DOM events.
See: https://alpinejs.dev/directives/on for official documentation.
func Ref ¶
Ref in combination with $refs is a useful utility for easily accessing DOM elements directly. It's most useful as a replacement for APIs like getElementById and querySelector.
See: https://alpinejs.dev/directives/ref for official documentation.
func Show ¶
Show is one of the most useful and powerful directives in Alpine. It provides an expressive way to show and hide DOM elements.
See: https://alpinejs.dev/directives/show for official documentation.
func Text ¶
Text sets the text content of an element to the result of a given expression.
See: https://alpinejs.dev/directives/text for official documentation.
Source Files ¶
alpine.go
- Version
- v0.0.0-20231010043146-4292577f982b (latest)
- Published
- Oct 10, 2023
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 2 days ago –
Tools for package owners.