Overview
Van Element
exposes a single function: define(...)
. It can take up to 3 arguments:
name
Custom element tag.element
VanJS functional component.options
(optional)
Extra Shadow DOM options.
The provided VanJS functional component will be called with an object containing the following properties:
attr()
Method to retrieve the value of a given attribute.mount()
Lifecycle hook to registermount
anddismount
callbacks.$this
Refers to the instance of the created custom element. Useful for accessing properties or binding event listeners.