const std = @import("std"); const z = @import("z"); const Self = @This(); pub const component: z.Component = .{ .name = "hello", .html = .native( .div, .{ .onclick = "@clicked" }, .content("click me"), ), .css = @embedFile("index.css"), .link = @This(), }; element: *z.Object, counter: usize, pub fn init(self: *Self, element: *z.Object) void { self.element = element; self.counter = 0; } pub fn clicked(self: *Self) void { self.counter += 1; std.log.info("clicked {} times", .{self.counter}); }