v2.4.0
版本发布时间: 2020-08-20 05:39:49
lit/lit-element最新发布版本:v2.4.0(2020-08-20 05:39:49)
Changed
- Set type in package.json to "module" (#974)
Added
-
Adds a
cache: boolean
argument to the@query
decorator as a performance optimization for properties whose queried element is not expected to change. If cache is set to true, element DOM is queried when the property is first accessed, and the value is cached so it can be immediately returned on all subsequent property accesses. (#1013) -
Adds a
selector: string
argument to the@queryAssignedNodes
decorator as a convenience to filter the assigned nodes by the given selector (#1016). -
The
requestUpdateInternal(name, oldValue, options)
method has been added. This method is sometimes useful to call in a custom property setter to optimize performance. It is slightly more efficient thanrequestUpdate
since it does not return theupdateComplete
property which can be overridden to do work. -
The protected
performUpdate()
method may now be called to syncronously "flush" a pending update, for example via a property setter. Note, performing a synchronous update only updates the element and not any potentially pending descendants in the element's local DOM (#959). -
Constructible stylesheets may now be provided directly as styles, in addition to using the
css
tagged template function (#853).
Fixed
- queryAssignedNodes doesn't correctly locate default slot (#1002)