mirror of
https://gitee.com/ulthon/layui-ul.git
synced 2026-07-07 12:52:48 +08:00
提交树形组件,但是逻辑和结构不合适,重构
This commit is contained in:
@@ -84,8 +84,36 @@
|
||||
})
|
||||
}
|
||||
renderRepeat('body')
|
||||
|
||||
$('.demo-js-src').each(function () {
|
||||
var html = $(this).html();
|
||||
var htmlList = html.split(/[\n]/g);
|
||||
var htmlListNew = []
|
||||
var baseLineBlankNums = -1;
|
||||
htmlList.forEach(function (htmlLine, htmlIndex) {
|
||||
if (htmlIndex == 0 && htmlLine.length == 0) {
|
||||
return true
|
||||
}
|
||||
if (baseLineBlankNums < 0) {
|
||||
var kong = htmlLine.match(/^ */g) //筛选
|
||||
if (kong != null) {
|
||||
baseLineBlankNums = kong[0].length
|
||||
} else {
|
||||
baseLineBlankNums = 0
|
||||
}
|
||||
}
|
||||
|
||||
htmlListNew.push(htmlLine.slice(baseLineBlankNums))
|
||||
});
|
||||
|
||||
$(this).siblings('pre.demo-js').html(htmlListNew.join("\n"))
|
||||
})
|
||||
layui.form.render()
|
||||
layui.element.render()
|
||||
layui.code({
|
||||
encode: true
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user