Support string types when defining properties
This commit is contained in:
parent
d442c40f25
commit
502b0512d3
|
@ -191,6 +191,8 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
DataType = function Text(s) {
|
||||
return s;
|
||||
};
|
||||
} else if(typeof DataType === 'string') {
|
||||
DataType = getSchemaType(DataType);
|
||||
}
|
||||
|
||||
Object.defineProperty(ModelClass.prototype, attr, {
|
||||
|
@ -211,6 +213,7 @@ ModelBuilder.prototype.define = function defineClass(className, properties, sett
|
|||
if (value === null || value === undefined) {
|
||||
this.__data[attr] = value;
|
||||
} else {
|
||||
console.log(attr, value);
|
||||
this.__data[attr] = DataType(value);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue