diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-26 09:23:55 +0100 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-10-26 09:23:55 +0100 |
| commit | 91d9b6992ac0ebee13704a3faefa8fd41a00075e (patch) | |
| tree | ea0a30cc0cfb2232d3e60c845c20a67b6cdf0b99 /src/app/components/image/root.zig | |
| parent | 65300a13dcd11037218bf8ba61efd8ca19e5920e (diff) | |
zilch: dynamic element creation
Diffstat (limited to 'src/app/components/image/root.zig')
| -rw-r--r-- | src/app/components/image/root.zig | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/app/components/image/root.zig b/src/app/components/image/root.zig index 971713d..c9aeef4 100644 --- a/src/app/components/image/root.zig +++ b/src/app/components/image/root.zig @@ -1,8 +1,18 @@ const zilch = @import("zilch"); -pub const component: zilch.Component = .{ +pub const component: zilch.Component = .build(.{ .name = "image", .html = .parse(@embedFile("index.html")), .css = @embedFile("index.css"), .link = @This(), -}; +}); + +const Self = @This(); + +element: *zilch.Object, + +pub fn init(self: *Self, element: *zilch.Object) !void { + self.element = element; +} + +pub const connect = component.connect; |