Commit Graph
13 Commits
Author SHA1 Message Date
Maccesch a2825fb13c updated examples with the new optional props 2022-03-16 06:36:39 +00:00
Maccesch 9a23ee4612 active_class prop for Router 2022-03-13 16:35:28 +00:00
Jonathan Kelley cc4b073f0d fix: use ordering of routes for router 2022-03-09 17:50:39 -05:00
Jonathan Kelley cc83900334 feat: router crate is polished up 2022-03-04 13:16:37 -05:00
Jonathan Kelley f2979cb12a feat: apply local router changes 2022-03-04 13:16:37 -05:00
Denis Richartz b71cf6ed4a cargo fmt 2022-02-16 16:11:57 +01:00
Denis Richartz ee2e986a30 fix unnecessary div 2022-02-16 15:34:43 +01:00
Jonathan Kelley 3edf3e367f wip: debugging 2022-01-30 14:08:03 -05:00
Jonathan Kelley 29ed7ebece feat: connect an onchange listener 2022-01-25 15:06:37 -05:00
Dave Rolsky 3c6142fb9d Commit WIP on router
There are a few different changes in here that probably need to be picked
apart. I'm sure much of this is wrong.

* Fix missing `dyn` that compiler complained about in router.rs

* Make UseRoute store a `Rc<RouterService>` rather than a string so we can get
information out of the router like current location.

* Implement `UseRoute`'s nth_segment and last_segment methods. I changed the
return type to a String because of the above.

* Remove some unused imports in platform/mod.rs and service.rs

* Implement the `use_route` fn. It panics if called outside a Router { } (I
think). I think that makes sense.

* Add a `current_location` method to `RouterService` that returns the current
location. I needed this both for the `UseRoute` implementation and _also_ so I
could get at this in my webapp code. I think having some way to get this will
be useful for others, whether or not this exact API is used. In my case, I
want to compare the current path to the `to` path of a `Link` so I can use a
different class for that `Link` if it is the currently active page.
2022-01-13 12:21:06 -06:00
Jonathan Kelley d2372717bd feat: flatten props attrs 2022-01-10 02:57:03 -05:00
Jonathan Kelley 427b126bc1 feat: add prevent default attribute and upgrade router 2022-01-05 16:34:24 -05:00
Jonathan Kelley cb2782b4bb wip: memoize dom in the prescence of identical components 2022-01-05 00:27:22 -05:00