Settings - Infomaker/Dashboard-Plugin GitHub Wiki
Dashboard.Settings
INFO
Deprecated: ref={STRING
}:
<GUI.ConfigInput ref='username'/>
use callback refs
instead:
<GUI.ConfigInput ref={refs => this.handleRefs(refs, 'username')}/>
see: https://reactjs.org/docs/refs-and-the-dom.html for more info.
this.handleRefs()
is a dashboard api will handle your refs and pass them as a config object
Getting started
Settings component used for your plugin settings config
Simple Settings
class MySettings extends Dashboard.Settings {
plugin() {
return(
<GUI.ConfigInput name={'username'} ref={refs => this.handleRefs(refs, 'username')}/>
<GUI.ConfigPassword name={'password'} ref={refs => this.handleRefs(refs, 'password')}/>
)
}
}
You can access your config from Dashboard components with props.config.username && props.config.password