Skip to content
This repository has been archived by the owner on Jul 19, 2020. It is now read-only.

RouterLink to support child components #192

Closed
jetli opened this issue Dec 9, 2019 · 2 comments · Fixed by #194
Closed

RouterLink to support child components #192

jetli opened this issue Dec 9, 2019 · 2 comments · Fixed by #194
Labels
enhancement New feature or request Help Wanted The maintainers are unlikely to implement this in a timely manner, but will accept PRs high priority Issues with this tag will be worked on before others

Comments

@jetli
Copy link
Contributor

jetli commented Dec 9, 2019

Description
Can we add child components support to RouterLink ? Now we can only use simple text property to set children of RouterLink, e.g.

<RouterLink ...>
    <i class="ion-edit"></i> { "Edit Article" }
</RouterLink >

a senario: https://github.com/jetli/rust-yew-realworld-example-app/blob/a99af18ec64ef74d6c3ac97419fc7de47eaa892d/crates/conduit-wasm/src/components/article/article_actions.rs#L79 , similar to button bellow.

@jetli jetli added the enhancement New feature or request label Dec 9, 2019
@hgzimmerman hgzimmerman added Help Wanted The maintainers are unlikely to implement this in a timely manner, but will accept PRs high priority Issues with this tag will be worked on before others labels Dec 9, 2019
@hgzimmerman
Copy link
Member

Yes. This wasn't really practical until very recently with the removal of the type parameter from Html in the Yew crate.

Now that that is gone, its very simple to just replace the text: String field with a children: Children one.

@hgzimmerman
Copy link
Member

As part of this change. I think RouterLink should be renamed to RouterAnchor in order to not have similar naming to ComponentLink and AgentLink which have behaviors very different from RouterLink.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request Help Wanted The maintainers are unlikely to implement this in a timely manner, but will accept PRs high priority Issues with this tag will be worked on before others
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants