初学bootstrap treeciew之自定义节点显示内容

 自定义节点显示内容,由于客户需求不得已再次研究了一下发现还能这么写

var tree = [
        {
            text:"<i class='fa fa-user'></i>"
        },
        {
            text:"<a onclick='alert(111)'>点击弹窗</a>"
        },
        {
            text:"<button>Parent</button>"
        },
        {
            text:"<input type='text' class='pull-right' id='date_time_picker'>"
        }
    ];

用于演示只写了很简单的东西,写成这样子也能显示,不得不说功能很强大

'text' => '<a style="width:100%;"<div class="mui-media-body"> 
<div class="mui-input-row" style="color: DeepSkyBlue">
<div class="mui-icon mui-icon-location-filled"></div>xxxxxxxx (40/PM2.5)</div>
<p style="font-size: 14px; ">
联系人:xxxx&emsp;&emsp;&emsp;&emsp;&emsp;&emsp; 电话: xxxxxxx</p>
<p style="font-size: 14px; ">地址:xxxxxxxxxxxxxxxx</p>
<p style="font-size: 14px; ">状态:<span style="color:#red">1</span>&emsp;
<button class="mui-btn mui-btn-success" onclick="goTrend(\'xxxxxx\')" 1>
查看详情</button>&emsp;
<button class="mui-btn mui-btn-warning" onclick="goModule(\'xxxxx\')">
查看设备</button></p></div></a>'
          

上效果图

猜你喜欢

转载自blog.csdn.net/qq_29099209/article/details/81508582