mirror of
https://github.com/vxcontrol/ncform.git
synced 2026-06-30 22:17:58 -04:00
Merge pull request #7 from vipshop/fix/input-trim
perf(ncform-theme-elementui): input trim
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user