yew/examples/nested_list
Muhammad Hamza 0eb167ac78
Remove ToHtml trait (#3453)
* remove ToHtml trait

* re-add display impls

* make Vec::clone expilit

* fix doc

* fix conflicting impls

Into<Html> and Display can't be implemented on the same type

* update docs

* blanket impl won't work here

* bring back `Vec<VNode>: IntoPropValue<VNode>`

* macro tests

* Revert "fix conflicting impls"

This reverts commit 52f3c1fa8174489ba9cc783d708a49cc7b9c90a4.
These impls are fine now

* make examples compile

* .clone() should be before .into()

* Rc VList

* Make use of ImplicitClone and AttrValue in example

(There is more work to do but it's complicated so I will do it in
another PR)

* Impl ImplicitClone on VChild

---------

Co-authored-by: Cecile Tonglet <cecile.tonglet@cecton.com>
2023-10-28 16:11:28 +05:00
..
2023-10-28 16:11:28 +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