对lua __index的理解
text = { }
text.defaultValue = { size = "h", content = "hello" }
text.mt = { } -- 创建元表
function text.new( a )
setmetatable( a, text.mt )
return a
end
text.mt.__index = function( tq, key )--tq中的...
原创
2018-06-27 13:09:06 ·
153 阅读 ·
0 评论