DEV: Add @model/@models support in d-navigation-item (#23074)
This commit is contained in:
parent
a5542eeab0
commit
91e5fa506d
|
@ -4,7 +4,13 @@
|
|||
class={{@class}}
|
||||
...attributes
|
||||
>
|
||||
<LinkTo @route={{@route}}>
|
||||
{{yield}}
|
||||
</LinkTo>
|
||||
{{#if this.models}}
|
||||
<LinkTo @route={{@route}} @models={{this.models}}>
|
||||
{{yield}}
|
||||
</LinkTo>
|
||||
{{else}}
|
||||
<LinkTo @route={{@route}}>
|
||||
{{yield}}
|
||||
</LinkTo>
|
||||
{{/if}}
|
||||
</li>
|
|
@ -1,5 +1,6 @@
|
|||
import Component from "@glimmer/component";
|
||||
import { inject as service } from "@ember/service";
|
||||
import { makeArray } from "discourse-common/lib/helpers";
|
||||
|
||||
export default class DNavigationItem extends Component {
|
||||
@service router;
|
||||
|
@ -26,4 +27,8 @@ export default class DNavigationItem extends Component {
|
|||
return "page";
|
||||
}
|
||||
}
|
||||
|
||||
get models() {
|
||||
return makeArray(this.args.models || this.args.model);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue