因为以下原因,您没有权限编辑本页:
您可以查看和复制此页面的源代码。
-- 自定义的trim函数,现在也去除换行符
local function trim(s)
return (s:gsub("[\n\r]+", ""):gsub("^%s*(.-)%s*$", "%1"))
end
local p = {}
local mw = require('mw')
p.cache = {} -- 初始化缓存
function p.navplateSmwRow(frame)
local args = frame:getParent().args
local categoryName = args[1]
local property = args[2]
local text = args[3]
local icon = args[4]
-- 使用缓存结果,减少查询
local cacheKey = categoryName .. (property or '') .. (text or '')
if p.cache[cacheKey] then
000
1:0
本页使用的模板: