lua中 使用tab制作模块

--module.lua

module = {}

module.num = 13

module.f1 = function (a,b)
return a + b
end

 

 

--test.lua


require('module')

print(module.f1(5,6)) --11

posted @ 2020-09-29 15:09  流星曳尾  阅读(278)  评论(0编辑  收藏  举报