This commit is contained in:
Insality
2024-11-20 23:36:04 +02:00
parent f2fa5320d2
commit 7ea8691fc5
104 changed files with 451 additions and 12743 deletions

View File

@@ -1,16 +1,16 @@
local component = require("druid.component")
---@class component_name : druid.base_component
local M = component.create("component_name")
---@class widget.TEMPLATE: druid.widget
local M = {}
-- Component constructor. Template name and nodes are optional. Pass it if you use it in your component
function M:init(template, nodes)
self.druid = self:get_druid(template, nodes)
function M:init()
self.root = self:get_node("root")
self.button = self.druid:new_button("button", function() end)
self.button = self.druid:new_button("button", self.on_button, self)
end
return M
function M:on_button()
print("Root node", self.root)
end
return M