0

我在流星中添加了 mizza:sharejs-codemirror 但它给出了错误“无法在没有初始化的情况下访问 sharejs”这是错误 ,html代码是:

<head>
	<title>textcircle</title>
</head>

<body>
	<h1>Welcome to TextCircle</h1>
	{{>editor}}
</body>

<template name="editor">
	{{>sharejsCM docid=docid id="editor"}}
</template>
这是js文件:

Documents=new Mongo.Collection("documents");
if (Meteor.isClient){
console.log(Meteor);
Template.editor.helpers({
	docid:function() {
		return Documents.findOne()._id;
	}
});
}

if (Meteor.isServer){
	Meteor.startup(function(){
		// code to run on server at startup
		console.log("helo");
		if(Documents.findOne()){
    Documents.insert({title:"my new document"});
}
	})
}

4

0 回答 0