模块:View:修订间差异

无编辑摘要
无编辑摘要
第8行: 第8行:
      
      
     -- 2. 载入模板
     -- 2. 载入模板
     local result = frame:getParent():expandTemplate{ title = args["模板变量:技能组成"], args = {num="12"} }
     local result = frame:getParent():expandTemplate{ title = args["模板变量:技能组成"], args = payload }
     mw.dumpObject(payload)
     mw.dumpObject(payload)



2024年6月24日 (一) 16:46的版本

可在模块:View/doc创建此模块的帮助文档

local p = {} --p stands for package

function p.renderComponents( frame, payload)
    local args = frame.args
    
	-- 1. 载入 json 文件
    payload = mw.loadJsonData( args["payload"] )
    
    -- 2. 载入模板
    local result = frame:getParent():expandTemplate{ title = args["模板变量:技能组成"], args = payload }
    mw.dumpObject(payload)

    return result
end

return p