mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update new component template, replace component name with M as module name
This commit is contained in:
@@ -9,7 +9,7 @@ local component = require("druid.component")
|
||||
|
||||
---@class {COMPONENT_TYPE}: druid.base_component{COMPONENT_ANNOTATIONS}
|
||||
---@field druid druid_instance
|
||||
local {COMPONENT_NAME} = component.create("{COMPONENT_TYPE}")
|
||||
local M = component.create("{COMPONENT_TYPE}")
|
||||
|
||||
local SCHEME = {
|
||||
{SCHEME_LIST}
|
||||
@@ -18,15 +18,15 @@ local SCHEME = {
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function {COMPONENT_NAME}:init(template, nodes)
|
||||
function M:init(template, nodes)
|
||||
self:set_template(template)
|
||||
self:set_nodes(nodes)
|
||||
self.druid = self:get_druid(){COMPONENT_DEFINE}
|
||||
end
|
||||
|
||||
|
||||
function {COMPONENT_NAME}:on_remove()
|
||||
function M:on_remove()
|
||||
end
|
||||
|
||||
{COMPONENT_FUNCTIONS}
|
||||
return {COMPONENT_NAME}
|
||||
return M
|
||||
|
Reference in New Issue
Block a user