我有一個架構與集合:無法呈現的自動窗體模板
export const Cources = new Meteor.Collection('Cources');
Cources.schema = new SimpleSchema({
courcePath: {
type: String,
label: 'Cource path'
},
courceTitle: {
type: String,
label: 'Cource title',
max: 200
},
courceDescription: {
type: String,
label: 'Cource description'
},
lessonsNumber: {
type: Number,
label: 'Lessons number',
min: 1
},
courceDuration: {
type: String,
label: 'Cource duration'
}
});
Cources.attachSchema(Cources.schema);
而且模板:
<template name="AddCource_page">
<div class="container">
{{> quickForm collection="Cources" id="insertCourceForm" type="insert"}}
</div>
</template>
但是,形式不渲染和存在錯誤控制檯:Error: Cources is not in the window scope
。當我添加助手時也會出現同樣的問題。我如何解決它?謝謝。
你可能是指「課程」而不是「Cource」。無論如何,如果你刪除'export const',它是否工作? –
嘗試刪除'Course.schema'並改爲使用'coursesSchema' –