Module:Sandbox/Star0/1:修订间差异
小无编辑摘要 |
(// Edit via Wikiplus) |
||
第1行: | 第1行: | ||
local p = {} | local p = {} | ||
function p.maint() | function p.maint() | ||
local loadJson = require('Module:LoadJson') | |||
json = loadJson.Songlist() | json = loadJson.Songlist() | ||
s = #json["songs"] | s = #json["songs"] |
2022年7月28日 (四) 00:22的版本
可在Module:Sandbox/Star0/1/doc创建此模块的帮助文档
local p = {}
function p.maint()
local loadJson = require('Module:LoadJson')
json = loadJson.Songlist()
s = #json["songs"]
return s
end
-- local Gjson = mw.text.jsonDecode(mw.getCurrentFrame():expandTemplate{ title = 'Songlist' } )
function p.main()
json = Gjson
s = #json["songs"]
return s
end
function p.test(key)
local c
if key==true then c = 2 end
if c==nil then return '无值' else return '有值' end
end
return p