function cc.exports.findValueByTbl(tbl,key)--递归方法,用于查找tbl中对应的键值

    for k,v in pairs(tbl) do

        if k == key then

            if type(tbl[i])=="table" then--如果是table类型,递归查找

                return findValueByTbl(v,key)

            else

                return v

            end

        end

end

end

相关文章:

  • 2021-12-01
  • 2021-11-02
  • 2021-09-07
  • 2022-12-23
  • 2021-06-28
  • 2021-09-27
  • 2021-09-05
  • 2021-11-15
猜你喜欢
  • 2021-07-31
  • 2022-01-25
  • 2022-12-23
  • 2021-10-08
  • 2022-01-27
  • 2022-02-05
  • 2022-12-23
相关资源
相似解决方案