Forms 使用Vazco“;制服“;在《流星与阿波罗》中
我刚刚开始在我的中使用,但我遇到了一个难以解决的难题:Forms 使用Vazco“;制服“;在《流星与阿波罗》中,forms,graphql,meteor-react,react-apollo,mantrajs,Forms,Graphql,Meteor React,React Apollo,Mantrajs,我刚刚开始在我的中使用,但我遇到了一个难以解决的难题: <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=""
<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>
我将桥接定义设置为:
:
:
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
。。。然后
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
。。。然后
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
如果这里的列表不够,请告诉我。它是可写的,但您没有对它做任何操作。根据文档,
BaseForm
必须以与字段相同的方式使用,其中model
是值,onChange
是。。。当然,onChange
。您可能想使用AutoForm
或自己处理表单-自述文件中很少有示例。我理解我的错误。我正在设置每个字段的值
,期望与HTML表单字段的行为相同:一个可编辑的初始值。这样设置的初始值似乎无法编辑。而且,我只成功使用AutoForm。如果我尝试使用ValidatedQuickForm或其他任何字段,则没有字段是可编辑的。正如名称所述,AutoForm
自动处理更改,并且ValidatedQuickForm
是一个带有绑定验证和自动生成内容的BaseForm
。