local t = {} local proxy = {} local mt = { __newindex = proxy -- 指向另一个表 } setmetatable(t, mt) t.newKey = "value" -- 触发 __newindex -- 因为 __newindex 是 proxy 表,所以会执行 proxy.newKey = "value" print(t.newKey) -- 输出: nil(t 本身没有) print(proxy.newKey

🤖 回答引擎: 后端Lua | 🕒 时间: 2026-03-11 14:28:32 | 👁️ 阅读: 9
← 返回问答库