Update new component template, replace component name with M as module name

This commit is contained in:
Insality
2024-08-29 09:28:54 +03:00
parent 7e16dacbc2
commit ba1ab07e0d
2 changed files with 7 additions and 7 deletions

View File

@@ -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