wuxw
2019-12-01 648ece2547005afbd8c5082b72bce32155f975e7
java110-front/src/main/java/com/java110/front/core/VcCreateProcessor.java
@@ -103,9 +103,14 @@
        String namespace = tag.getAttributeValue("namespace");
        return js.replace("this.", "vc.component." + namespace + "_")
        js = js.replace("this.", "vc.component." + namespace + "_")
                .replaceAll("(\\$)+( )*+(\\()+( )*+\'+#", "\\$('#" + namespace + "_")
                .replaceAll("(\\$)+( )*+(\\()+( )*+\"+#", "\\$(\"#" + namespace + "_");
        //将 监听也做优化
        js = js.replaceAll("(vc.on)+\\('", "vc.on('" + namespace + ",");
        return js;
    }
@@ -244,7 +249,7 @@
        js = js.substring(0, extPos) + tmpProTypes.substring(0, pos).trim()
                + "\nnamespace:'" + namespace.trim() + "',\n" + tmpProTypes.substring(pos, tmpProTypes.length());
        int position = js.indexOf("{");
        String propsJs = "\n$namespace='" + namespace.trim() + "';\n";
        String propsJs = "\nvar $namespace='" + namespace.trim() + "';\n";
        js = new StringBuffer(js).insert(position + 1, propsJs).toString();
        return js;
    }