wuxw
2019-07-20 b7d06e0d47e6dd8f2d8ea3f558ae972f231325d0
WebService/src/main/java/com/java110/web/core/VcCreateProcessor.java
@@ -117,14 +117,20 @@
            return js;
        }
        String[] tmpType = tmpProTypes.split(",");
        String[] tmpType = tmpProTypes.contains("\r\n")
                        ? tmpProTypes.split("\r\n")
                        : tmpProTypes.split(",");
        StringBuffer propsJs = new StringBuffer("\nvar $props = {};\n");
        for (String type : tmpType) {
            if (StringUtils.isEmpty(type) || !type.contains(":")) {
                continue;
            }
            String[] types = type.split(":");
            String attrKey = types[0].replace(" ", "")
            String attrKey = "";
            if (types[0].contains("//")) {
                attrKey = types[0].substring(0, types[0].indexOf("//"));
            }
            attrKey = types[0].replace(" ", "")
                    .replace("\n", "")
                    .replace("\r", "");
            if (!tag.hasAttribute(attrKey)) {
@@ -133,7 +139,7 @@
                throw new TemplateProcessingException("组件[" + componentName + "]未配置组件属性" + attrKey);
            }
            String vcType = tag.getAttributeValue(attrKey);
            if (types[1].equals("vc.propTypes.string")) {
            if (types[1].contains("vc.propTypes.string")) {
                vcType = "'" + vcType + "'";
            }
            propsJs.append("$props." + attrKey + "=" + vcType + ";\n");