先上效果图
上代码
$('#dg').tree({
url:'/test',
method:'post',
onLoadSuccess: function () {
$('.tree-icon.tree-file ').css("background", "url(/img/base/tree_leaf.png) no-repeat center center");
$('.tree-icon.tree-folder').css("background", "url(/img/base/tree_forld.png) no-repeat center center");
}
});
总结
1.此方法是直接通过CSS样式设置。
2.其中url中的内容,要设置你自己的图片路径,路径不对加载不出来。
欢迎大家点赞、收藏、关注、评论啦!!!