Meteor:如何导入包含页面、图像、链接等的网站
我是新来的流星。我有一个网站,我想转换成流星。我必须设置路由器并更改所有链接吗?或者我可以使用在html页面之间导航的现有href链接吗?图像会成为问题吗?每个页面标题中的css和javascript都有效吗?如果你有路由,你应该使用meteor包定义它 因此,如果您有类似于Meteor:如何导入包含页面、图像、链接等的网站,meteor,Meteor,我是新来的流星。我有一个网站,我想转换成流星。我必须设置路由器并更改所有链接吗?或者我可以使用在html页面之间导航的现有href链接吗?图像会成为问题吗?每个页面标题中的css和javascript都有效吗?如果你有路由,你应该使用meteor包定义它 因此,如果您有类似于myUrl/about的内容 你应该在《流星》中这样做 Router.route('about',function(){ this.render('about') //and you should have a <
myUrl/about
的内容
你应该在《流星》中这样做
Router.route('about',function(){
this.render('about') //and you should have a <template name="about></template>
})
所有这些都是因为就像你在问题上说的,你有路线,如果你没有路线的话
如果您想在实时编辑器上测试它,可以使用
我建议您阅读这本书或安装,这也是一个很好的选择添加到您的网站
// Router Example
Router.configure({
layoutTemplate: 'Layout' //Layout is a template for your website
});
Router.map(function() {
this.route('index', {path: '/'}); // Index is an another template
});
布局模板应具有{>yield}
标记
<template name="Layout">
// Include header in separate template
{{> yield}}
// Include footed in separate template
</template>
<template name="index">
<!-- Page content -->
</template>
希望这将足够简单的网站
<template name="Layout">
// Include header in separate template
{{> yield}}
// Include footed in separate template
</template>
<template name="index">
<!-- Page content -->
</template>
Template.Layout.onRendered({
//JQuery content HERE
});