yew/examples/nested_list
Kaede Hoshikawa 71b0f206a1
Allow any type to be used as Children (take 2) (#3289)
* Partially copy useful implementation.

* Adjust conversion.

* Temporary fix iterator.

* Add ToString implementation.

* Add Renderable trait.

* Make Macro tests pass.

* Add tests for render_prop as Children.

* Update benchmark and Children used in yew packages.

* Selective suppress lints.

* Rollback unintentional rollback.

* Fix rustfmt.

* Remove unneeded implementation.

* Update Comment.

* Rollback more changes.

* Rollback more changes.

* Fix website.

* Fix documentation tests.

* Add prelude.

* Fix test.

* Blanket Implementation for &'_ T for Renderable types.

* Implement Renderable for &str.

* Update signature.

* Update children to Html in examples.

* Remove unnecessary dereferencing.

* Rollback nested_list example.

* Fix comment.

* Convert to Pattern Matching.

* Add tracing issue.

* Rename Renderable to ToHtml.

* Move ToHtml to yew::html.

* Convert more to match pattern.
2023-06-11 15:33:39 +05:00
..
2022-04-11 17:02:59 +05:00
2020-09-22 00:17:48 +02:00

Nested List Example

Demo

This example shows a nested list and displays which item was last hovered.

Concepts

  • Creating components which only accepts specific child elements
  • Communicating with a component that isn't a parent. See WeakComponentLink in main.rs.

Improvements

  • ListItem Component has a hide prop which is currently only used statically. It should be possible to make the hidden items visible by pressing a button.

Running

Run this application with the trunk development server:

trunk serve --open