mirror of
https://github.com/phfroidmont/scalive.git
synced 2025-12-25 05:26:59 +01:00
Initial support for JS commands
This commit is contained in:
parent
d42472061b
commit
6f012b6796
4 changed files with 62 additions and 5 deletions
|
|
@ -4,8 +4,8 @@ import zio.stream.ZStream
|
|||
|
||||
class HomeLiveView() extends LiveView[String, Unit]:
|
||||
val links = List(
|
||||
"/counter" -> "Counter",
|
||||
"/list" -> "List"
|
||||
"/counter" -> "Counter",
|
||||
"/list?q=test" -> "List"
|
||||
)
|
||||
|
||||
def init = ZIO.succeed(())
|
||||
|
|
|
|||
|
|
@ -54,7 +54,11 @@ class ListLiveView(someParam: String) extends LiveView[Msg, Model]:
|
|||
phx.click := Msg.IncAge(1),
|
||||
"Inc age"
|
||||
),
|
||||
span(cls := "grow")
|
||||
span(cls := "grow"),
|
||||
button(
|
||||
phx.click := JS.toggleClass("bg-red-500 border-5"),
|
||||
"Toggle color"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue