-- __newindex 对表进行更新 MyMetatable = {} MyTable = setmetatable({["newKey"] = }, {__newindex = MyMetatable}) MyTable.newKey1 = print(MyTable.newKey1) --- nil print(MyMetatable.newKey1) --- 156