mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-11 06:07:24 +08:00
优化命名空间bug
This commit is contained in:
parent
23352b187a
commit
add5ca2d71
@ -32,6 +32,12 @@
|
||||
<script src="/js/plugins/select2/select2.full.min.js"></script>
|
||||
<script src="/js/plugins/echart/echarts.min.js"></script>
|
||||
<script src="/js/plugins/echart/china.js"></script>
|
||||
|
||||
<!-- SUMMERNOTE 富文本组件-->
|
||||
<link href="/css/plugins/summernote/summernote-bs4.min.css" rel="stylesheet">
|
||||
<script src="/js/plugins/summernote/summernote-bs4.min.js"></script>
|
||||
<script src="/js/plugins/summernote/summernote-zh-CN.min.js"></script>
|
||||
<script src="/js/plugins/xss/xss.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<vc:create name="bodyTop"></vc:create>
|
||||
|
||||
@ -226,7 +226,7 @@
|
||||
let _componentElement = await loadComponent(_componentName, _tree);
|
||||
//_tree.setHtml(_componentElement);
|
||||
|
||||
console.log('_componentElement>>', _componentElement)
|
||||
//console.log('_componentElement>>', _componentElement)
|
||||
|
||||
if (vcFramework.isNotNull(_componentElement)) {
|
||||
var vcChildElements = _componentElement.getElementsByTagName('vc:create');
|
||||
@ -281,6 +281,8 @@
|
||||
|
||||
} else {
|
||||
_vcCreateEl.innerHTML = _componentBody[0].innerHTML;
|
||||
//_vcCreateEl.parentNode.replaceChild(_componentBody[0], _vcCreateEl);
|
||||
|
||||
}
|
||||
//将js 脚本放到 组件 脚本中
|
||||
if (vcFramework.isNotEmpty(_tree.js)) {
|
||||
@ -405,8 +407,8 @@
|
||||
|
||||
_html = _html.replace(/this./g, _namespaceValue + "_");
|
||||
|
||||
_html = _html.replace('(id)+( )*+=+( )*+/g', "id='" + _namespaceValue + "_");
|
||||
_html = _html.replace("(id)+( )*+=+( )*+/g", 'id="' + _namespaceValue + '_');
|
||||
_html = _html.replace(/(id)( )*=( )*'/g, "id='" + _namespaceValue + "_");
|
||||
_html = _html.replace(/(id)( )*=( )*"/g, 'id="' + _namespaceValue + '_');
|
||||
return _html;
|
||||
};
|
||||
/**
|
||||
@ -546,13 +548,13 @@
|
||||
|
||||
let _namespaceValue = _componentVcCreate.getAttribute("namespace");
|
||||
_js = _js.replace(/this./g, "vc.component." + _namespaceValue + "_");
|
||||
_js = _js.replace("(\\$)+( )*+(\\()+( )*+'+#/g", "\\$('#" + _namespaceValue + "_");
|
||||
_js = _js.replace(/(\$)( )*(\()( )*'#/g, "\$('#" + _namespaceValue + "_");
|
||||
|
||||
_js = _js.replace('(\\$)+( )*+(\\()+( )*+"+#/g', "\\$(\"#" + _namespaceValue + "_");
|
||||
_js = _js.replace(/(\$)( )*(\()( )*"#/g, "\$(\"#" + _namespaceValue + "_");
|
||||
|
||||
//将 监听也做优化
|
||||
_js = _js.replace("(vc.on)+\\('/g", "vc.on('" + _namespaceValue + "','");
|
||||
_js = _js.replace('(vc.on)+\\("/g', "vc.on(\"" + _namespaceValue + "\",\"");
|
||||
_js = _js.replace(/(vc.on)\('/g, "vc.on('" + _namespaceValue + "','");
|
||||
_js = _js.replace(/(vc.on)\("/g, "vc.on(\"" + _namespaceValue + "\",\"");
|
||||
return _js;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user