【发布时间】:2018-12-04 00:28:14
【问题描述】:
我是流星新手。我正在为 quickForm 使用简单的模式并收到此错误。 模板助手中的异常:TypeError:无法读取未定义的属性“mergedSchema”
main.html
<template name="hello">
<button>Click Me</button>
<p>You've pressed the button {{counter}} times.</p>
{{> quickForm collection="Books" id="bookUpdateForm" type="insert"}}
</template>
main.js
import './hello.html';
import { Books } from '../../../api/links/books.js';
Template.hello.onCreated(function () {
Meteor.subscribe('books');
});
集合 JS
import SimpleSchema from 'simpl-schema';
export const Books = new Mongo.Collection("books");
const Book = new SimpleSchema({
title: {
type: String,
label: "Title",
max: 200
},
author: {
type: String,
label: "Author"
},
copies: {
type: SimpleSchema.Integer,
label: "Number of copies",
min: 0
},
lastCheckedOut: {
type: Date,
label: "Last date this book was checked out",
optional: true
},
summary: {
type: String,
label: "Brief summary",
optional: true,
max: 1000
}
});
Books.attachSchema(Book);
【问题讨论】:
-
请添加一些代码,否则很难判断错误的来源。例如,这可能是错误的导入、模式的丢失或错误实例化、模式对象丢失等等。
-
我已添加代码,请查看此内容。有时我遇到这个问题模板助手中的异常:错误:书籍不在窗口范围内我尝试了这个解决方案github.com/aldeed/meteor-autoform/issues/1449现在我得到了这个异常在模板助手中:TypeError:无法读取未定义的属性“mergedSchema”
标签: meteor meteor-autoform simpl-schema