当前位置 博文首页 > 浮若星光的博客:layui中tree组件使用报错tree.render is not a

    浮若星光的博客:layui中tree组件使用报错tree.render is not a

    作者:[db:作者] 时间:2021-06-26 15:39

    Uncaught TypeError:tree.render is not a function
    		at n .<anonymous><tree:21>
    		at c (layui.js?111:2)
    		at r (layui.js?111:2)
    

    解决方案一:可能你是用的layui的版本为2.5之前的版本,他将不被兼容,
    因此既,你需要将layui的版本改为2.5.4之后的版本。记住,是整个插件的要更改。

    解决方案二:可以看看引入tree插件时用的是否是单引号,是的话改为双引号,然后清除缓存。

    $(function(){
    	layui.use(["tree"],function () {
    		layuiTree = layui.tree;
    	})
    })