Ember.js 错误:断言失败:必须向组件的链接提供一个或多个参数
我正在遵循,添加Ember.js 错误:断言失败:必须向组件的链接提供一个或多个参数,ember.js,ember-router,Ember.js,Ember Router,我正在遵循,添加标记时出错。我不确定这意味着什么,因为我找不到任何文档,我需要做什么来正确构造这个标签 我需要做些什么来正确地构造它?它不会在页面上呈现 这是我的环境: 余烬cli:3.6.1 节点:13.12.0 os:Darwinx64 以下是控制台中的错误: Error: Assertion Failed: You must provide one or more parameters to the link-to component. 下面是相关的代码片段 app/templates/
标记时出错。我不确定这意味着什么,因为我找不到任何文档,我需要做什么来正确构造这个标签
我需要做些什么来正确地构造它?它不会在页面上呈现
这是我的环境:
余烬cli:3.6.1
节点:13.12.0
os:Darwinx64
以下是控制台中的错误:
Error: Assertion Failed: You must provide one or more parameters to the link-to component.
下面是相关的代码片段
app/templates/index.hbs
<div class="jumbo">
<div class="right tomster"></div>
<h2>Welcome to Super Rentals!</h2>
<p>We hope you find exactly what you're looking for in a place to stay.</p>
<LinkTo @route="about">About</LinkTo>
</div>
您的调用语法是正确的。但是,您参考的是最新版本的Ember指南,而您已经安装了Ember版本3.6。你可以将你的余烬版本升级到最新版本,或者如果你想坚持3.6版本,也可以升级到3.6版本 实际的错误是由于内置的组件的真正的尖括号组件调用样式只是这样,您的Ember版本必须=>3.10才能工作 下面是一个示例,演示如何使用Ember 3.17版使用
链接到组件
import EmberRouter from '@ember/routing/router';
import config from './config/environment';
export default class Router extends EmberRouter {
location = config.locationType;
rootURL = config.rootURL;
}
Router.map(function() {
this.route('about');
});