Closed ALuShu closed 3 years ago
后台接口返回的数据是children格式的,如下: boolean类型的数据都是正常的,经过下面的处理渲染: ` /**
// eleTree实例化 var ele = eleTree({ el: '#eletree1', data: treeData, draggable: true, indent: 30, highlightCurrent: true, accordion: true, imgUrl: "../../plugins/eletree/images/", icon: { fold: "connections.png", leaf: "video.png", checkFull: ".eletree_icon-check_full", checkHalf: ".eletree_icon-check_half", checkNone: ".eletree_icon-check_none", dropdownOff: ".eletree_icon-dropdown_right", dropdownOn: ".eletree_icon-dropdown_bottom", loading: ".eleTree-animate-rotate.eletree_icon-loading1", radioCheck: "radioCheck.png", radioCheckNone: "radioCheckNone.png", }, customText: function(data) { var s = data.label if (data.pid === "") { s+=<i class="eletree_icon-edit edit_test"></i> <i class="eletree_icon-delete delete_test"></i> } return s } }) ` 这是渲染后log出来的数据,上面是on事件的data,下面是我上面ajax存起来的一个treeData,事件的data.data正常,不知为啥treeData会在渲染后改变这个值,true为2,false为0
<i class="eletree_icon-edit edit_test"></i> <i class="eletree_icon-delete delete_test"></i>
@ALuShu
@hsiangleev 好的,已经用别的方案解决
后台接口返回的数据是children格式的,如下: boolean类型的数据都是正常的,经过下面的处理渲染: ` /**
// eleTree实例化 var ele = eleTree({ el: '#eletree1', data: treeData, draggable: true, indent: 30, highlightCurrent: true, accordion: true, imgUrl: "../../plugins/eletree/images/", icon: { fold: "connections.png", leaf: "video.png", checkFull: ".eletree_icon-check_full", checkHalf: ".eletree_icon-check_half", checkNone: ".eletree_icon-check_none", dropdownOff: ".eletree_icon-dropdown_right", dropdownOn: ".eletree_icon-dropdown_bottom", loading: ".eleTree-animate-rotate.eletree_icon-loading1", radioCheck: "radioCheck.png", radioCheckNone: "radioCheckNone.png", }, customText: function(data) { var s = data.label if (data.pid === "") { s+=
<i class="eletree_icon-edit edit_test"></i> <i class="eletree_icon-delete delete_test"></i>
} return s } }) ` 这是渲染后log出来的数据,上面是on事件的data,下面是我上面ajax存起来的一个treeData,事件的data.data正常,不知为啥treeData会在渲染后改变这个值,true为2,false为0