lua module

aa.lua

complex={


}

function complex.showName()
    print ("woshi dongshen ")
end

return complex

1.lua

local mymodule=require("aa")

mymodule.showName();
原文地址:https://www.cnblogs.com/yufenghou/p/4302481.html