Merge pull request #7 from vipshop/fix/input-trim

perf(ncform-theme-elementui): input trim
This commit is contained in:
daniel-dx
2018-07-27 17:45:48 +08:00
committed by GitHub
2 changed files with 32 additions and 10 deletions
@@ -64,17 +64,17 @@
Vue.use(vueNcform, { extComponents: { object, input } });
let formSchemas = [
{
title: '默认状态',
schema: {
type: 'object',
properties: {
name: {
type: 'string',
{
title: '默认状态',
schema: {
type: 'object',
properties: {
name: {
type: 'string',
}
}
}
}
},
},
{
title: '提供值',
schema: {
@@ -92,6 +92,22 @@
}
}
},
{
title: '[属性] trim: 前后去空格',
schema: {
type: 'object',
properties: {
name: {
type: 'string',
ui: {
widgetConfig: {
trim: true
}
}
}
}
}
},
{
title: '[属性] readonly: 只读状态',
schema: {
@@ -447,6 +447,11 @@ export default {
val = parseInt(val);
val = isNaN(val) ? "" : val;
break;
case "string":
if(this.mergeConfig.trim){
val = val.toString().trim();
}
break;
}
if (typeof this.value === "object") {
@@ -463,7 +468,8 @@ export default {
] = this.$data.appendSelectVal;
}
return obj;
} else {
}
else{
this.$data.inputVal = val;
return val;
}