好吧,如果你想做"流星之路"有两个基本选项,你需要决定最适合你的需求:
一个.您可以使用UI.insert和UI.render(或UI.renderWithData,如果您需要渲染数据,请将要使用的模板注入占位符,例如:
UI.insert(UI.render(Template.name), document.body) UI.insert(UI.renderWithData(Template.foo, {bar: "baz"}), document.body)
b:您可以在模板中使用基于会话的条件,并将其命令仅在设置某个会话时出现,例如:
click me to make the sign up form appear{{#with userPressedSignUp}} {{/with} Template.signInForm.userPressedSignUp = -> return Session.get 'signUp-visible" Template.signInForm.events 'click .signUp': (event) -> Session.set 'signUp-visible', true Session.set 'signUp_visible', false # The template will not show the contents of the "with" as long as the session # variable is 'false', change it by clicking on "signUp" div when you want the form to appear推荐阅读
如何解决《C++指向文件的向量》经验,为你挑选了1个好方法。 ... [详细] 如何解决《Travis-CI:在.travis.yml文件的deploy部分中使用环境变量》经验,为你挑选了0个好方法。 ... [详细] 如何解决《'Classname<T>,T:Classname<T>'的作用是什么?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《XamariniOSC#下划线UIButton文本》经验,为你挑选了1个好方法。 ... [详细] 如何解决《不包含拆分方法》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在Java8函数样式中,如何将值映射到现有的键值对》经验,为你挑选了1个好方法。 ... [详细] 如何解决《列出仅在当前目录中超过x天的所有文件》经验,为你挑选了1个好方法。 ... [详细] 如何解决《重新启动后,Kafka主题不再存在》经验,为你挑选了1个好方法。 ... [详细] 如何解决《有没有办法将现有的"特征"分配给史诗?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《BEM与SASS和:悬停》经验,为你挑选了2个好方法。 ... [详细] 如何解决《如何使用FOSHttpCacheBundle和Varnish进行缓存标记?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《tableview使用swift2.0在ios开发中不显示单元分隔符行.xcode7》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何在elixir的Ecto查询中使用"case-when"?》经验,为你挑选了1个好方法。 ... [详细] 如何解决《使用未部署在Azure中的应用程序访问AzureKeyVault存储的密钥》经验,为你挑选了1个好方法。 ... [详细] 如何解决《并行计算:仅在每个线程中加载一次包》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何在std::map中创建新条目而不复制条目值-没有指针》经验,为你挑选了1个好方法。 ... [详细] 如何解决《在Scala2.11中进行模式匹配的穷举检查》经验,为你挑选了1个好方法。 ... [详细] 如何解决《如何更改Rails4中的按钮文本?》经验,为你挑选了1个好方法。 ... [详细] 吐了个 "CAO" !Tags | 热门标签RankList | 热门文章
- 1使用LIKE或MATCH的SQL查询
- 2如何使用lambda将数组中的每个项目相乘?
- 3Azure中的Wordpress托管,集成了媒体服务和上传器安全性
- 4此搜索方法中IComparable和IComparable <T>之间的差异
- 5在Android API级别23上访问UserDictionary Content Provider
- 6清除错误后,TextInputLayout.setError()会留空空格
- 7如何循环参数java?
- 8`pip install pyside`冻结在Linux上?
- 9Python中的方法重载:更多重载
- 10Rails:为什么我的服务器将http重定向到https
- 11在c ++中使用"this"关键字对性能有影响吗?
- 12这个AngularJS工厂的例子究竟如何?有些疑惑
- 13GOCR没有使用培训结果
- 14如何在Xcode中调整UIStackView的子视图?
- 15可靠地将类型符号(ITypeSymbol)与Roslyn进行比较
- 16什么是hadoop中的序列文件?
- 17需要有关Flask安全模块的密码散列算法的建议
- 18如何设置pep8 linter接受2个空格缩进?
- 19过滤其值小于0的pandas数据帧行
- 20在Ansible中,是否可以根据剧本定义身份验证方法?
DevBox开发工具箱 | 专业的在线开发工具网站 京公网安备 11010802040832号 | 京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有