mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 10:02:18 +02:00
Update
This commit is contained in:
@@ -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
|
Reference in New Issue
Block a user