gpt4 book ai didi

meteor - 如何在 meteor 中找到当前模板?

转载 作者:行者123 更新时间:2023-12-02 05:53:41 24 4
gpt4 key购买 nike

有没有查找当前模板的功能?

<template name="Login">
<h1>{{template}}</h1> //Should display Login
</template>

<template name="Login">
<h1>{{showtemplate}}</h1>
</template>

Helperjs:

showtemplate: function(){
return Template;
}

最佳答案

如果你想要模板的名称,可以这样获取:

showtemplate: function(){
return Template.instance().view.name;
}

这将返回字符串“Template.yourTemplateName”

关于meteor - 如何在 meteor 中找到当前模板?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32931681/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com