【发布时间】:2015-10-11 02:50:41
【问题描述】:
做完之后:meteor add marcinn:paperjs.
它产生一个错误,因为路径没有定义(framePreview.js 中的 paperjs Path() 函数)
缺少什么(paper.js 存在于包和包列表文件中)
这是我的测试:
---tsite01.html (stands for test site 01)
<head>
<title>tsite01</title>
<!-- Load the Paper.js library-->
<script type="text/paperscript" src="papers/framePreview.js" canvas="framePreview"> </script>
</head>
<body>
<h1>Hello World!</h1>
{{> hello}}
<canvas id="framePreview" resize></canvas>
</body>
<template name="hello">
<button>Click here</button>
<p>You've pressed the bouton {{counter}} times.</p>
</template>
--- framePreview.js in papers subdirectory
var path=new Path();
path.strokeColor='black';
var start= new Point(100,100);
path.moveTo(start);
path.lineTo(start+[10,-50]);
-- tsite.js
if (Meteor.isClient) {
// counter starts at 0
Session.setDefault('counter', 0);
Template.hello.helpers({
counter: function () {
return Session.get('counter');
}
});
Template.hello.events({
'click button': function () {
// increment the counter when button is clicked
Session.set('counter', Session.get('counter') + 1);
}
});
}
if (Meteor.isServer) {
Meteor.startup(function () {
// code to run on server at startup
});
}
【问题讨论】:
-
Meteor 包安装在
~/.meteor/packages。这个包应该出现在~/.meteor/packages/marcinn_paperjs