Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README.md | 2023-04-18 | 896 Bytes | |
v0.5.1 source code.tar.gz | 2023-04-18 | 141.9 kB | |
v0.5.1 source code.zip | 2023-04-18 | 149.2 kB | |
v0.5.1.tar.gz | 2023-04-18 | 141.9 kB | |
v0.5.1.zip | 2023-04-18 | 149.2 kB | |
Totals: 5 Items | 583.0 kB | 0 |
SPA, States And More Other 🎉
In this release we added powerful state management and components!
Components
Project structure:
project/
-- components/
-- -- hello_world.nim
-- main.nim
project/components/hello_world.nim
:::nim
import happyx
component MyComponent:
counter: int
`template`:
{self.counter}
button:
"Increase"
@click:
self.counter += 1
`script`:
echo self.counter
`style`:
"""
button {
background: #212121;
color: #dfdfdf;
padding: 12px {self.counter + 1}px;
}
"""
project/main.nim
:::nim
import happyx
var app = registerApp()
app.routes:
"/":
component MyComponent(counter = 5)
app.start()