【发布时间】:2016-11-01 22:24:51
【问题描述】:
所以我在一个 html 页面中使用了 4 个模板。模板 1 是默认模板,无论何时访问此 html 页面,您都应该看到它。
但是,当我浏览其他模板和其他 html 页面后,当我返回此页面时,它会显示我离开该页面时所在的模板,而不是默认模板。
HTML:
<template name = "Page1">
<div class = "events">
{{>Template.dynamic template=selector}}
</div>
</template>
<template name = "template1">...</template>
<template name = "template2">...</template>
<template name = "template3">...</template>
<template name = "template4">...</template>
Javascript:
if(Meteor.isClient) {
Session.setDefault("selector","eventDetailPage");
Template.showEvent.helpers ({
selector: function () {
return Session.get("selector");
}
});
Template.showEvent.events ({
'click #temp2': function(){
Session.set('selector’,'template2')
}
});
...template 2, 3, 4...
}
【问题讨论】:
-
showEvent模板在哪里?
标签: javascript html templates meteor