Module:Tabs:修订间差异
跳转到导航
跳转到搜索
无编辑摘要 |
无编辑摘要 |
||
(未显示同一用户的1个中间版本) | |||
第16行: | 第16行: | ||
table.sort(sorted) | table.sort(sorted) | ||
-- | -- 确定默认标签位置(基于参数顺序) | ||
local | local default_pos = math.min(tonumber(args.DefaultTab) or 1, #sorted) | ||
-- 构建标签内容 | -- 构建标签内容 | ||
local tabberContent = {} | local tabberContent = {} | ||
for | for pos, idx in ipairs(sorted) do | ||
local title = args['bt'..idx] or '' | local title = args['bt'..idx] or '' | ||
local content = args['tab'..idx] or '' | local content = args['tab'..idx] or '' | ||
table.insert(tabberContent, string.format('|-| %s = %s', title, content)) | table.insert(tabberContent, string.format('|-| %s=%s', title, content)) | ||
end | end | ||
第34行: | 第33行: | ||
end | end | ||
-- | -- 添加数学函数兼容 | ||
math. | math.min = math.min or function(a, b) return a < b and a or b end | ||
end | |||
return p | return p |