zpin-templates
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -180,3 +180,24 @@ 'use strict'; | ||
} else if (key === classAttr || key === reactSupport.classNameProp) { | ||
props[propKey] = existing + utils.convertText(node, context, val.trim()); | ||
//20161103 | ||
val = val.trim(); | ||
// console.log(val) | ||
// if(val.indexOf("{this.styles.")<0){ | ||
// val="{this.styles."+val+"}"; | ||
// } | ||
if (val.indexOf("{this.styles.") < 0) { | ||
var arr = val.split(" "); | ||
var result = "{["; | ||
arr.forEach(function (v, i) { | ||
result += "this.styles." + v.trim(); | ||
if (i != arr.length - 1) { | ||
result += ","; | ||
} | ||
}); | ||
result += "].join(' ')}"; | ||
// val="{this.styles."+val+"}"; | ||
} | ||
// console.log(result);1 | ||
props[propKey] = existing + utils.convertText(node, context, result); | ||
// props[propKey] = existing + utils.convertText(node, context,val.trim()); | ||
// props[propKey] = existing + utils.convertText(node, context, val.trim()); | ||
} | ||
@@ -183,0 +204,0 @@ } else if (!_.startsWith(key, 'rt-')) { |
{ | ||
"name": "zpin-templates", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Light weight templates for react -> write html get valid react code", | ||
@@ -5,0 +5,0 @@ "main": "./dist/cli.js", |
@@ -194,3 +194,24 @@ 'use strict'; | ||
} else if (key === classAttr || key === reactSupport.classNameProp) { | ||
props[propKey] = existing + utils.convertText(node, context, val.trim()); | ||
//20161103 | ||
val=val.trim(); | ||
// console.log(val) | ||
// if(val.indexOf("{this.styles.")<0){ | ||
// val="{this.styles."+val+"}"; | ||
// } | ||
if(val.indexOf("{this.styles.")<0){ | ||
var arr=val.split(" "); | ||
var result="{["; | ||
arr.forEach(function (v,i) { | ||
result+="this.styles."+v.trim(); | ||
if(i!=arr.length-1){ | ||
result+="," | ||
} | ||
}) | ||
result+="].join(' ')}" | ||
// val="{this.styles."+val+"}"; | ||
} | ||
// console.log(result);1 | ||
props[propKey] = existing + utils.convertText(node, context,result); | ||
// props[propKey] = existing + utils.convertText(node, context,val.trim()); | ||
// props[propKey] = existing + utils.convertText(node, context, val.trim()); | ||
} | ||
@@ -197,0 +218,0 @@ } else if (!_.startsWith(key, 'rt-')) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
298077
3643