The Select component displays a input, surrounded with some extra elements for styling. It accepts the following attrs: options A map of option values to labels. onchange A callback to run when the selected value is changed. value The value of the selected option. disabled Disabled state for the input. wrapperAttrs A map of attrs to be passed to the DOM element wrapping the <select> Other attributes are passed directly to the <select> element rendered to the DOM. HierarchyComponentSelectIndexConstructorsconstructorPropertiesattrselementstateMethods$onbeforeremoveonbeforeupdateoncreateoninitonremoveonupdateviewcomponentinitAttrsConstructorsconstructornew Select(): SelectReturns SelectPropertiesProtected attrsattrs: ComponentAttrs The attributes passed into the component. seehttps://mithril.js.org/components.html#passing-data-to-components Protected elementelement: Element The root DOM element for the component. Protected statestate: undefined Class component state that is persisted between redraws. Updating this will not automatically trigger a redraw, unlike other frameworks. This is different to Vnode state, which is always an instance of your class component. This is undefined by default. MethodsProtected $$(selector?: string): JQuery<HTMLElement> Returns a jQuery object for this component's element. If you pass in a selector string, this method will return a jQuery object, using the current element as its buffer. For example, calling component.$('li') will return a jQuery object containing all of the li elements inside the DOM element of this component. finalParametersOptional selector: stringReturns JQuery<HTMLElement>the jQuery object for the DOM node onbeforeremoveonbeforeremove(vnode: VnodeDOM<ComponentAttrs, Select>): voidParametersvnode: VnodeDOM<ComponentAttrs, Select>Returns voidonbeforeupdateonbeforeupdate(vnode: VnodeDOM<ComponentAttrs, Select>): voidParametersvnode: VnodeDOM<ComponentAttrs, Select>Returns voidoncreateoncreate(vnode: VnodeDOM<ComponentAttrs, Select>): voidParametersvnode: VnodeDOM<ComponentAttrs, Select>Returns voidoninitoninit(vnode: Vnode<ComponentAttrs, Select>): voidParametersvnode: Vnode<ComponentAttrs, Select>Returns voidonremoveonremove(vnode: VnodeDOM<ComponentAttrs, Select>): voidParametersvnode: VnodeDOM<ComponentAttrs, Select>Returns voidonupdateonupdate(vnode: VnodeDOM<ComponentAttrs, Select>): voidParametersvnode: VnodeDOM<ComponentAttrs, Select>Returns voidviewview(): ElementReturns ElementStatic componentcomponent<SAttrs>(attrs?: SAttrs, children?: Children): Vnode<{}, {}> Convenience method to attach a component without JSX. Has the same effect as calling m(THIS_CLASS, attrs, children). seehttps://mithril.js.org/hyperscript.html#mselector,-attributes,-children Type parametersSAttrs: ComponentAttrs<SAttrs> = ComponentAttrsParametersattrs: SAttrs = ...children: Children = nullReturns Vnode<{}, {}>Static Protected initAttrsinitAttrs<T>(attrs: T): void Initialize the component's attrs. This can be used to assign default values for missing, optional attrs. Type parametersTParametersattrs: TReturns voidModules@types/global@types/tooltipssrc/adminsrc/admin/componentssrc/admin/modelssrc/admin/resolverssrc/admin/utilssrc/commonsrc/common/components<internal>src/common/extendsrc/common/helperssrc/common/modelssrc/common/resolverssrc/common/statessrc/common/utilssrc/forumsrc/forum/componentssrc/forum/resolverssrc/forum/statessrc/forum/utilsSelectconstructorattrselementstate$onbeforeremoveonbeforeupdateoncreateoninitonremoveonupdateviewcomponentinitAttrsOSLightDark
Select
options
onchange
value
disabled
wrapperAttrs
<select>
Other attributes are passed directly to the <select> element rendered to the DOM.
The attributes passed into the component.
https://mithril.js.org/components.html#passing-data-to-components
The root DOM element for the component.
Class component state that is persisted between redraws.
Updating this will not automatically trigger a redraw, unlike other frameworks.
This is different to Vnode state, which is always an instance of your class component.
This is undefined by default.
undefined
Returns a jQuery object for this component's element. If you pass in a selector string, this method will return a jQuery object, using the current element as its buffer.
For example, calling component.$('li') will return a jQuery object containing all of the li elements inside the DOM element of this component.
component.$('li')
li
the jQuery object for the DOM node
Convenience method to attach a component without JSX. Has the same effect as calling m(THIS_CLASS, attrs, children).
m(THIS_CLASS, attrs, children)
https://mithril.js.org/hyperscript.html#mselector,-attributes,-children
Initialize the component's attrs.
This can be used to assign default values for missing, optional attrs.
Generated using TypeDoc version 0.22.10
The
Selectcomponent displays aGenerated using TypeDoc version 0.22.10