修改目录的说明;

This commit is contained in:
augushong
2021-09-06 18:59:47 +08:00
parent 3e4f08e520
commit 4f4a26184c
2 changed files with 23 additions and 7 deletions

View File

@@ -144,10 +144,10 @@
<p>目录数据,示例:</p> <p>目录数据,示例:</p>
<p> <p>
[{ [{
id: 0, id: 0, //必须 <br>
pid: 0, pid: 0, <br>
title: 0, title: 0, <br>
options: 同列表设置,如果不需要请设置为空数组 options: 同列表设置,如果不需要请设置为空数组 <br>
}] }]
</p> </p>
</td> </td>
@@ -162,6 +162,21 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr>
<td>appendItem(item)</td>
<td>
<p>将目录向上移动,没有返回值</p>
<p>参数:</p>
<p>item:list的其中一个目录数据,必须有id属性</p>
</td>
</tr>
<tr>
<td>renderList()</td>
<td>
<p>当调用了appendItem之后,必须调用renderList,才能显示,没有参数</p>
</td>
</tr>
<tr> <tr>
<td>itemMoveUp(item)</td> <td>itemMoveUp(item)</td>
<td> <td>

View File

@@ -61,7 +61,7 @@ function renderUlTree(options) {
var itemSetting = $.extend({}, defaults, data); var itemSetting = $.extend({}, defaults, data);
settings.list.push(itemSetting); settings.list.push(itemSetting);
this.initList()
} }
this.initList = function () { this.initList = function () {
@@ -124,6 +124,7 @@ function renderUlTree(options) {
}); });
} }
this.renderList = function () { this.renderList = function () {
this.initList()
thisDom.find('.ul-tree-item').each(function (index, elem) { thisDom.find('.ul-tree-item').each(function (index, elem) {
tthis.renderItem(elem) tthis.renderItem(elem)