fix(JSON-Schema): 修复前端组件加载数据时数字类型没有转化string

修复前端组件加载数据时数字类型没有转化string
This commit is contained in:
song-tianyang 2021-11-24 17:55:30 +08:00 committed by song-tianyang
parent bd7ab558a9
commit ccfe17f077
1 changed files with 3 additions and 0 deletions

View File

@ -40,6 +40,9 @@
created() {
if (this.schema.mock && Object.prototype.toString.call(this.schema.mock).match(/\[object (\w+)\]/)[1].toLowerCase() === 'object') {
this.mock = this.schema.mock;
if(typeof(this.mock.mock) === 'number'){
this.mock.mock = this.mock.mock+"";
}
} else {
this.schema.mock = this.mock;
}