0.9.0 • Published 1 year ago

@esroute/lit v0.9.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@esroute/lit

An integration of esroute into lit

This library provides a renderRoutes() directive to render the routes that are resolved by the router.

You can use the createRouter() factory to create the router instance.

Example

import { createRouter, renderRoutes } from "@esroute/lit";
import { html, LitElement } from "lit";
import { customElement } from "lit/decorators.js";

const router = createRouter({
  routes: {
    "": () =>
      import("./routes/root").then(() => html`<esroute-root></esroute-root>`),
    foo: {
      "*": ({ params: [name] }) =>
        import("./routes/foo").then(
          () => html`<my-greeter greeting=${name}></my-greeter>`
        ),
    },
  },
});

@customElement("my-demo")
export class Demo extends LitElement {
  render() {
    return html`${renderRoutes(router)}`;
  }
}
0.9.0

1 year ago

0.8.3

1 year ago

0.8.2

1 year ago

0.8.1

2 years ago

0.7.2

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.5.4

3 years ago

0.5.3

3 years ago

0.5.0

3 years ago

0.6.1

3 years ago

0.5.2

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.1.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago