如何链接到应用程序的根路径

 用户kltt快乐天天 发布于 2023-01-29 14:33

我找不到如何链接到我的Ember应用程序的根路径.我尝试过:{{#link-to 'index'}}Home{{/link-to}}但是在我的控制台中我得到了异常:Assertion failed: The attempt to link-to route 'index' failed (also tried 'index.index'). The router did not find 'index' in its possible routes: 'loading', 'error', 'start.loading', 'start.error'

当我尝试时也一样 {{link-to 'application'}}

这是我的路由器:

App.Router.map(function() {
  this.resource('start', { path: '/start' }, function() {
    //.. sub routes ..
  });
  this.resource('intro', { path: '/' }, function() {
    // ...
  });
  this.route('login')
});

Kingpin2k.. 28

根据您使用的版本,它index现在用于支持现在application也可用于链接回根目录.

{{link-to 'Back to Home' 'application' }}

{{link-to 'Back to Home 2' 'index' }}

http://emberjs.jsbin.com/OxIDiVU/188/edit

1 个回答
  • 根据您使用的版本,它index现在用于支持现在application也可用于链接回根目录.

    {{link-to 'Back to Home' 'application' }}
    
    {{link-to 'Back to Home 2' 'index' }}
    

    http://emberjs.jsbin.com/OxIDiVU/188/edit

    2023-01-29 14:35 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有