append="tree"不正常
单位只能是px或者纯数字
Proposal- Support to use CSS units in Weex DSL
/**
* the values below is valid
* - number
* - number + 'px'
*
* @param {string} v
* @return {function} a function to return
* - value: number|null
* - reason(k, v, result)
*/
var LENGTH_VALIDATOR = function LENGTH_VALIDATOR(v) {
v = (v || '').toString()
var match = v.match(LENGTH_REGEXP)
if (match) {
var unit = match[1]
if (!unit) {
return {value: parseFloat(v)}
}
else if (SUPPORT_CSS_UNIT.indexOf(unit) > -1) {
return {value: v}
}
else {
return {
value: parseFloat(v),
reason: function reason(k, v, result) {
return 'NOTE: unit `' + unit + '` is not supported and property value `' + v + '` is autofixed to `' + result + '`'
}
}
}
}
return {
value: null,
reason: function reason(k, v, result) {
return 'ERROR: property value `' + v + '` is not supported for `' + util.camelCaseToHyphened(k) + '` (only number and pixel values are supported)'
}
}
}
这个函数做了限制,放开的话要修改这个系统函数