zpin-templates
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -24,3 +24,3 @@ 'use strict'; | ||
var classExclude = require("./classExclude"); | ||
var classExclude = require("./classExclude"); // | ||
@@ -184,20 +184,20 @@ var propsMergeFunction = 'function mergeProps(inline,external) {\n var res = _.assign({},inline,external)\n if (inline.hasOwnProperty(\'style\')) {\n res.style = _.defaults(res.style, inline.style);\n }\n if (inline.hasOwnProperty(\'className\') && external.hasOwnProperty(\'className\')) {\n res.className = external.className + \' \' + inline.className;\n }\n return res;\n}\n'; | ||
//多class问题 | ||
val = val.trim(); | ||
if (val.indexOf("{this.styles.") < 0) { | ||
var arr = val.split(" "); | ||
var result = "{["; | ||
arr.forEach(function (v, i) { | ||
if (classExclude.indexOf(v.trim()) < 0) { | ||
result += "this.styles['" + v.trim() + "']"; | ||
} else { | ||
result += "'" + v.trim() + "'"; | ||
} | ||
if (i != arr.length - 1) { | ||
result += ","; | ||
} | ||
}); | ||
result += "].join(' ')}"; | ||
} | ||
// val=val.trim(); | ||
// if(val.indexOf("{this.styles.")<0){ | ||
// var arr=val.split(" "); | ||
// var result="{["; | ||
// arr.forEach(function (v,i) { | ||
// if(classExclude.indexOf(v.trim())<0){ | ||
// result+="this.styles['"+v.trim()+"']"; | ||
// }else{ | ||
// result+="'"+v.trim()+"'"; | ||
// } | ||
// if(i!=arr.length-1){ | ||
// result+="," | ||
// } | ||
// }) | ||
// result+="].join(' ')}" | ||
// } | ||
// console.log(result); | ||
props[propKey] = existing + utils.convertText(node, context, result); | ||
props[propKey] = existing + utils.convertText(node, context, val.trim()); | ||
} | ||
@@ -204,0 +204,0 @@ } else if (!_.startsWith(key, 'rt-')) { |
{ | ||
"name": "zpin-templates", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "Light weight templates for react -> write html get valid react code", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,3 +21,3 @@ 'use strict'; | ||
const classExclude=require("./classExclude"); | ||
const classExclude=require("./classExclude");// | ||
@@ -198,20 +198,20 @@ const propsMergeFunction = `function mergeProps(inline,external) { | ||
//多class问题 | ||
val=val.trim(); | ||
if(val.indexOf("{this.styles.")<0){ | ||
var arr=val.split(" "); | ||
var result="{["; | ||
arr.forEach(function (v,i) { | ||
if(classExclude.indexOf(v.trim())<0){ | ||
result+="this.styles['"+v.trim()+"']"; | ||
}else{ | ||
result+="'"+v.trim()+"'"; | ||
} | ||
if(i!=arr.length-1){ | ||
result+="," | ||
} | ||
}) | ||
result+="].join(' ')}" | ||
} | ||
// val=val.trim(); | ||
// if(val.indexOf("{this.styles.")<0){ | ||
// var arr=val.split(" "); | ||
// var result="{["; | ||
// arr.forEach(function (v,i) { | ||
// if(classExclude.indexOf(v.trim())<0){ | ||
// result+="this.styles['"+v.trim()+"']"; | ||
// }else{ | ||
// result+="'"+v.trim()+"'"; | ||
// } | ||
// if(i!=arr.length-1){ | ||
// result+="," | ||
// } | ||
// }) | ||
// result+="].join(' ')}" | ||
// } | ||
// console.log(result); | ||
props[propKey] = existing + utils.convertText(node, context,result); | ||
props[propKey] = existing + utils.convertText(node, context,val.trim()); | ||
} | ||
@@ -218,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
283936
56
3547