我刚开始在我的Meteor Mantra Kickstarter中使用Vazco “制服”,但我遇到了一个难以解决的难题:
<section class="field form-group">
<label for="uniforms-0000-0002" class="control-label">
Content
</label>
<textarea class="form-control" id="uniforms-0000-0002" name="content" placeholder="">
</textarea>
</section>
textarea
例如,我的表单上所有其他类型的字段都是不可写的。
我可能会犯一些错误,导致我无法写入表单中的字段吗?
它的 JSX 看起来像这样:
<BaseForm disabled={false} placeholder={false} schema={this.bridge} >
<div className="row-fluid">
<div className="col-md-4">
<NumField grid={6} name="pages" label="# Pages" value="0"/>
<TextField name="title" label="Title" />
</div>
<div className="col-md-8">
<LongTextField name="content" label="Content"
disabled={false} placeholder={false} />
</div>
</div>
<ErrorsField />
</BaseForm>
我这样设置桥接定义:
:
:
this.schemaType = API_AST.getType('Book');
this.schemaValidator = model => {
const details = [];
};
this.schemaData = {
};
console.log("Book schema : ", this.schemaType);
console.log("Schema validator : ", this.schemaValidator);
console.log("Schema data : ", this.schemaData);
this.bridge = new GraphQLBridge(
this.schemaType
, this.schemaValidator
, this.schemaData
);
console.log("The bridge : ", this.bridge);
}
各种console.log( "..." )
说明显示:
Book schema : GraphQLObjectType
_fields: Object
_id: Object
author: Object
content: Object
pages: Object
title: Object
__proto__: Object
_interfaces: Array[0]
_typeConfig: Object,
description: ""
isTypeOf: undefined,
name: "Book",
__proto__: Object
... 然后 ...
Schema validator : function (model) { // 39
var details = [];
... 然后 ...
Schema data : Object
__proto__: Object
... 然后 ...
The bridge : GraphQLBridge
extras: Object
schema: GraphQLObjectType
_fields: Object
_id: Object
author: Object
content: Object
pages: Object
title: Object
__proto__: Object
_interfaces: Array[0]
_typeConfig: Object
description: ""
isTypeOf: undefined
name: "Book"
__proto__: Onject
validator: (model)
__proto__: Bridge
如果这里的列表不足,请告诉我。