在Meteor FAQs http://meteor.com/faq/how-do-i-package-a-new-templating-system中,有一些关于添加不同(比默认Handlebars)模板系统的信息.Jade是文档中其他地方明确指出的唯一其他示例.
有人在研究Jade吗?如果没有,我开始可行吗?还是现在还为时尚早?例如:
软件包API正在快速变化,并且没有记录,因此您无法创建自己的软件包.快来了.
在我目前的Ember.js项目中,我一直在努力爱上Handlebars,但对我来说,没有什么比Jade更优雅了.
我正在使用名为Timeline的软件包
https://github.com/VeriteCo/TimelineJS
它的工作原理是拥有一个占位符,例如
<div id="my-timeline"></div>
Run Code Online (Sandbox Code Playgroud)
然后最终制作一个jQuery调用来操纵div.在视觉上,我看到时间线出现在屏幕上,然后几乎消失.使用以下简单示例会产生类似的效果:
<div id="my-temp"></div>
Run Code Online (Sandbox Code Playgroud)
结合
$(document).ready(function() {
$('#my-temp').html('HELLO');
});
Run Code Online (Sandbox Code Playgroud)
在没有结果HTML消失的情况下执行此类操作的正确方法是什么?
我最近开始使用Meteor构建工具Chartist来表示我的数据。
我有图例模板的java脚本(来自互联网)
function drawBarChart() {
new Chartist.Bar('.legendChart1', {
labels: ['First quarter of the year', 'Second quarter of the year', 'Third quarter of the year', 'Fourth quarter of the year'],
series: [
{ "name": "Money A", "data": [60000, 40000, 80000, 70000] },
{ "name": "Money B", "data": [40000, 30000, 70000, 65000] }
]
}, {
plugins: [
Chartist.plugins.legend()
]
});
};
Template.legendTemplate.rendered = function(){
drawBarChart();
}
Run Code Online (Sandbox Code Playgroud)
<template name="legendTemplate">
<div class="legendChart1">
</div>
</template>
Run Code Online (Sandbox Code Playgroud)
以及相应的导入语句
import {legend} …Run Code Online (Sandbox Code Playgroud)