From 91d9b6992ac0ebee13704a3faefa8fd41a00075e Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Mon, 26 Oct 2026 09:23:55 +0100 Subject: zilch: dynamic element creation --- src/app/components/image/root.zig | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/app/components/image/root.zig') 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; -- cgit v1.2.3-70-g09d2