export class NavLink extends navigator()

in client/src/components/link.js [19:47]


export class NavLink extends navigator(LitElement) {
  static get properties() {
    return {
      href: { type: String },
    };
  }

  static get styles() {
    return styles;
  }

  constructor() {
    super();
    this.href = '';
  }

  onClick(event) {
    event?.preventDefault();
    this.navigate(this.href);
  }

  render() {
    return html`
      <a href="${this.href}" @click="${this.onClick}">
        <slot></slot>
      </a>
    `;
  }
}