Method Summary
| Public Methods | ||
| public |
buildSettingComponent(setting: *): JSX.Element buildSettingComponent takes a settings object and turns it into a component. |
|
| public |
|
|
| public |
dirty(): * |
|
| public |
header(): * |
|
| public |
headerInfo(): {"className": *, "icon": *, "title": *, "description": *} |
|
| public |
isChanged(): * |
|
| public |
oninit(vnode: *) |
|
| public |
onsaved() |
|
| public |
saveSettings(e: *): * |
|
| public |
|
|
| public |
submitButton(): * |
|
| public |
view(): * |
|
Inherited Summary
| From class Page | ||
| public |
A class name to apply to the body while the route is active. |
|
| public |
Whether we should scroll to the top of the page when its rendered. |
|
| public |
Whether the browser should restore scroll state on refreshes. |
|
| public |
oncreate(vnode: *) |
|
| public |
oninit(vnode: *) |
|
| public |
onremove(vnode: *) |
|
Public Methods
public buildSettingComponent(setting: *): JSX.Element source
buildSettingComponent takes a settings object and turns it into a component. Depending on the type of input, you can set the type to 'bool', 'select', or any standard <input> type. Any values inside the 'extra' object will be added to the component as an attribute.
Alternatively, you can pass a callback that will be executed in ExtensionPage's context to include custom JSX elements.
Params:
| Name | Type | Attribute | Description |
| setting | * |
Return:
| JSX.Element |
Example:
{
setting: 'acme.checkbox',
label: app.translator.trans('acme.admin.setting_label'),
type: 'bool',
help: app.translator.trans('acme.admin.setting_help'),
className: 'Setting-item'
}
{
setting: 'acme.select',
label: app.translator.trans('acme.admin.setting_label'),
type: 'select',
options: {
'option1': 'Option 1 label',
'option2': 'Option 2 label',
},
default: 'option1',
}
public headerInfo(): {"className": *, "icon": *, "title": *, "description": *} source
Return:
| {"className": *, "icon": *, "title": *, "description": *} |
Reference
Source
