Commit 931d3b7a by chenwq

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

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