diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-07 00:09:34 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-07 00:09:34 +0200 |
| commit | 4e86e3e18e9b43e442a35361ac82b30dd6c0103a (patch) | |
| tree | c37d84000608386147b910dd41df5743e947fd93 /src/app/components/hello/root.zig | |
| parent | 12a02f161504b49a54243bed996df6b44e25b7b4 (diff) | |
wasm implement components
Diffstat (limited to 'src/app/components/hello/root.zig')
| -rw-r--r-- | src/app/components/hello/root.zig | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/app/components/hello/root.zig b/src/app/components/hello/root.zig new file mode 100644 index 0000000..6f68550 --- /dev/null +++ b/src/app/components/hello/root.zig @@ -0,0 +1,17 @@ +const std = @import("std"); +const z = @import("z"); + +pub const component: z.Component = .{ + .name = "hello", + .html = .native( + .div, + .{ .onclick = "@clicked" }, + .content("click me"), + ), + .css = @embedFile("index.css"), + .link = @This(), +}; + +pub fn clicked() void { + z.log.js.debug("hi"); +} |