lit-ui-router / SrefActiveClassDirective
Class: SrefActiveClassDirective
Defined in: packages/lit-ui-router/src/sref-active.ts:297
The attribute-part sibling of UiSrefActiveDirective's class handling, with the contract of lit's classMap: bound in class, alone or beside static classes, and toggling only the classes it names.
The first commit writes the whole class list — statics plus whichever of ours apply — as classMap does, which is also what a server rendering render() alone would emit. Every commit after that toggles names on classList, so classes something else added to the element survive.
See
srefActiveClass for the public API
Extends
Properties
| Property | Modifier | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|---|
directiveName | readonly | string | the public function's name, for errors and warnings | SrefStatusDirective.directiveName | packages/lit-ui-router/src/sref-active.ts:95 |
params | public | | SrefActiveClassParams | undefined | the last params update() saw | SrefStatusDirective.params | packages/lit-ui-router/src/sref-active.ts:71 |
status | public | SrefStatus | undefined | merged status of every target, or undefined before there is one | SrefStatusDirective.status | packages/lit-ui-router/src/sref-active.ts:73 |
Methods
render()
render(params): string | typeof noChange;Defined in: packages/lit-ui-router/src/sref-active.ts:338
The classes that apply, space-padded to keep clear of the statics; or noChange before a status exists.
Parameters
| Parameter | Type |
|---|---|
params | SrefActiveClassParams |
Returns
string | typeof noChange