mirror of
https://github.com/ziex-dev/ziex.git
synced 2026-07-22 11:39:34 -06:00
43 lines
1.1 KiB
Zig
43 lines
1.1 KiB
Zig
pub fn Page(allocator: zx.Allocator) zx.Component {
|
|
var _zx = @import("zx").allocInit(allocator);
|
|
return _zx.ele(
|
|
.main,
|
|
.{
|
|
.allocator = allocator,
|
|
.children = &.{
|
|
_zx.cmp(
|
|
CounterComponent,
|
|
.{ .client = .{ .name = "CounterComponent", .id = "c8fee6a" } },
|
|
.{},
|
|
),
|
|
_zx.cmp(
|
|
CounterComponent,
|
|
.{},
|
|
.{},
|
|
),
|
|
_zx.cmp(
|
|
Button,
|
|
.{ .client = .{ .name = "Button", .id = "cd02624" } },
|
|
.{ .title = "Custom Button" },
|
|
),
|
|
},
|
|
},
|
|
);
|
|
}
|
|
|
|
pub fn CounterComponent(allocator: zx.Allocator) zx.Component {
|
|
var _zx = @import("zx").allocInit(allocator);
|
|
return _zx.ele(
|
|
.button,
|
|
.{
|
|
.allocator = allocator,
|
|
.children = &.{
|
|
_zx.txt("Counter"),
|
|
},
|
|
},
|
|
);
|
|
}
|
|
|
|
const Button = @import("basic.zig").Button;
|
|
const zx = @import("zx");
|