优化组合页面展示问题

This commit is contained in:
wuxw 2020-03-13 21:40:02 +08:00
parent 9580335b28
commit f2669fee97
4 changed files with 46 additions and 23 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -41,6 +41,9 @@
<link href="/css/jquery.step.css" rel="stylesheet"/>
<script src="/js/jquery.step.min.js" ></script>
<link rel="stylesheet" href="/css/bootstrap/bootstrap-treeview.min.css"/>
<script src="/js/bootstrap/bootstrap-treeview.min.js"></script>
</head>
<body>
<vc:create name="bodyTop"></vc:create>

View File

@ -258,7 +258,11 @@
let _vcCreateEl = document.getElementById(_tree.treeId);
let _componentHeader = _tree.html.getElementsByTagName('head');
let _componentBody = _tree.html.getElementsByTagName('body');
if(_vcCreateEl == null){
console.log('vcCreate',_vcCreateEl,_tree.treeId,_tree);
}
if (_vcCreateEl.hasAttribute("location") && 'head' == _vcCreateEl.getAttribute('location')) {
let _componentHs = _componentHeader[0].childNodes;
_header[0].appendChild(_componentHeader[0]);
@ -280,9 +284,17 @@
}
} else {
_vcCreateEl.innerHTML = _componentBody[0].innerHTML;
//_vcCreateEl.innerHTML = _componentBody[0].innerHTML;
//_vcCreateEl.parentNode.replaceChild(_componentBody[0], _vcCreateEl);
for(let _comBodyIndex = 0 ; _comBodyIndex < _componentBody.length; _comBodyIndex ++){
let _childNodes = _componentBody[_comBodyIndex].childNodes;
for(let _tmpChildIndex = 0 ; _tmpChildIndex < _childNodes.length; _tmpChildIndex ++){
_vcCreateEl.parentNode.insertBefore(_childNodes[_tmpChildIndex],_vcCreateEl)
}
}
}
//将js 脚本放到 组件 脚本中
if (vcFramework.isNotEmpty(_tree.js)) {