Commit 931d3b7a by chenwq

fix(GLCustForm): 添加isAgreeTrim选项控制输入值自动trim

当isAgreeTrim为false时自动trim输入值,避免不必要的字符串处理
1 parent acab072c
...@@ -176,10 +176,12 @@ Component({ ...@@ -176,10 +176,12 @@ Component({
value = number value = number
} }
} }
const diffValue = value.toString() if(!item.isAgreeTrim) {
const trimValue = value.toString().trim() const diffValue = value.toString()
if (diffValue != trimValue) { const trimValue = value.toString().trim()
value = trimValue if (diffValue != trimValue) {
value = trimValue
}
} }
thisPage.setData({ thisPage.setData({
......
...@@ -519,6 +519,7 @@ Page({ ...@@ -519,6 +519,7 @@ Page({
type: frontConfig.type, type: frontConfig.type,
labelWidth: frontConfig.labelWidth, labelWidth: frontConfig.labelWidth,
maxlength: frontConfig.maxlength || '140', maxlength: frontConfig.maxlength || '140',
isAgreeTrim: frontConfig.isAgreeTrim || false,
isLabelNoLine: frontConfig.isLabelNoLine, isLabelNoLine: frontConfig.isLabelNoLine,
inputAlign: frontConfig.inputAlign || 'right', inputAlign: frontConfig.inputAlign || 'right',
optionList: frontConfig.optionList || [], optionList: frontConfig.optionList || [],
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!