-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalpine.go
78 lines (62 loc) · 1.58 KB
/
alpine.go
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package alpine
import g "github.com/maragudk/gomponents"
// Data render the x-data attribute.
func Data(value string) g.Node {
return g.Attr("x-data", value)
}
// Bind render the x-bind attribute.
func Bind(attr, value string) g.Node {
return g.Attr("x-bind:"+attr, value)
}
// Bind render the x-on attribute.
func On(attr, value string) g.Node {
return g.Attr("x-on:"+attr, value)
}
// Bind render the x-text attribute.
func Text(value string) g.Node {
return g.Attr("x-text", value)
}
// Bind render the x-html attribute.
func HTML(value string) g.Node {
return g.Attr("x-html", value)
}
// Bind render the x-model attribute.
func Model(value string) g.Node {
return g.Attr("x-model", value)
}
// Bind render the x-show attribute.
func Show(value string) g.Node {
return g.Attr("x-show", value)
}
// Bind render the x-transition attribute.
func Transition() g.Node {
return g.Attr("x-transition")
}
// Bind render the x-for attribute.
func For(value string) g.Node {
return g.Attr("x-for", value)
}
// Bind render the x-if attribute.
func If(value string) g.Node {
return g.Attr("x-if", value)
}
// Bind render the x-init attribute.
func Init(value string) g.Node {
return g.Attr("x-init", value)
}
// Bind render the x-effect attribute.
func Effect(value string) g.Node {
return g.Attr("x-effect", value)
}
// Bind render the x-ref attribute.
func Ref(value string) g.Node {
return g.Attr("x-ref", value)
}
// Bind render the x-cloak attribute.
func Cloak() g.Node {
return g.Attr("x-cloak")
}
// Bind render the x-ignore attribute.
func Ignore() g.Node {
return g.Attr("x-ignore")
}