Bootstrap4.0兼容tree方法

bootstrap-treeview 是bootstrap的一个树形插件,他不可以在 bootstrap 高于 3.3.7 版本中使用。
 
那么,问题就来了,Bootstrap4.0中怎么办啦?
验证后发现,主要是Bootstrap4.0中将一些图标被去除了,设置一下就好
JS
$('#tree').treeview({
            data: html,
            expandIcon: "tree_arrows_right",  //设置列表树可展开节点的图标。
            collapseIcon: "tree_arrows_down",  //设置列表树可收缩节点的图标。
            levels : 5,
            showTags: true,
            highlightSelected: true,
            highlightSearchResults:false
        });
 
CSS
.tree_arrows_down:before{
    content:url("/static/image/sel.jpg");   //图片url根据地址设置
}
.tree_arrows_right:before{
    content:url("/static/image/sel.jpg");
}
 
HTML
<div id="tree">div>
 
 
posted @ 2019-05-09 09:32  朱俊销  阅读(547)  评论(0编辑  收藏  举报