mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update docs, update custom component templates
This commit is contained in:
25
druid/templates/component.template.lua
Normal file
25
druid/templates/component.template.lua
Normal file
@@ -0,0 +1,25 @@
|
||||
local component = require("druid.component")
|
||||
|
||||
local Component = component.create("component_name")
|
||||
|
||||
local SCHEME = {
|
||||
ROOT = "root",
|
||||
BUTTON = "button",
|
||||
}
|
||||
|
||||
|
||||
function Component:init(template, nodes)
|
||||
self:set_template(template)
|
||||
self:set_nodes(nodes)
|
||||
self.root = self:get_node(SCHEME.ROOT)
|
||||
self.druid = self:get_druid()
|
||||
|
||||
self.button = self.druid:new_button(SCHEME.BUTTON, function() end)
|
||||
end
|
||||
|
||||
|
||||
function Component:on_remove()
|
||||
end
|
||||
|
||||
|
||||
return Component
|
Reference in New Issue
Block a user