From 4e86e3e18e9b43e442a35361ac82b30dd6c0103a Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Wed, 7 Oct 2026 00:09:34 +0200 Subject: wasm implement components --- src/app/components/hello/root.zig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/app/components/hello/root.zig (limited to 'src/app/components/hello/root.zig') 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"); +} -- cgit v1.2.3-70-g09d2