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() {
return this.template
.onClick((event) => this.onClick(event))
.child(
new slot(this)
.class(this.active, (value) => { return value ? "active" : null })
);
.class(this.active, value => value ? "active" : null)
.child(new slot(this).class(this.active, value => value ? "active" : null));
}
ready() {