From add5ca2d71310c81acd19cda92012503a75b3c2c Mon Sep 17 00:00:00 2001
From: java110 <928255095@qq.com>
Date: Thu, 12 Mar 2020 00:55:40 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=91=BD=E5=90=8D=E7=A9=BA?=
=?UTF-8?q?=E9=97=B4bug?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/admin.html | 6 ++++++
public/vcCore/vcFramework.js | 16 +++++++++-------
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/public/admin.html b/public/admin.html
index 4e6aa44e0..63c068a1a 100644
--- a/public/admin.html
+++ b/public/admin.html
@@ -32,6 +32,12 @@
+
+
+
+
+
+
diff --git a/public/vcCore/vcFramework.js b/public/vcCore/vcFramework.js
index dc8ac505d..5e59f4332 100644
--- a/public/vcCore/vcFramework.js
+++ b/public/vcCore/vcFramework.js
@@ -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;
}