Adding active class to router link element as well and cleaned up code.

This commit is contained in:
Matt Mo 2020-12-12 13:28:32 -08:00
parent 39ed96ccb4
commit 50c4a75b49

View File

@ -34,10 +34,8 @@ class RouterLink extends IgniteElement {
render() { render() {
return this.template return this.template
.onClick((event) => this.onClick(event)) .onClick((event) => this.onClick(event))
.child( .class(this.active, value => value ? "active" : null)
new slot(this) .child(new slot(this).class(this.active, value => value ? "active" : null));
.class(this.active, (value) => { return value ? "active" : null })
);
} }
ready() { ready() {