|
|
|
# Frontend plugins
|
|
|
|
|
|
|
|
## Settings
|
|
|
|
|
|
|
|
You may include settings pages for your plugins. They must reside in the `settings` folder in your plugin.
|
|
|
|
|
|
|
|
The naming of your settings page components can be anything you want. There's no guidelines on the naming schemes besides being CamelCase, but it's recommended to include at least your plugin name and append `Settings`. This ensures there won't be any naming conflicts with other plugins.
|
|
|
|
|
|
|
|
The structure would look like this:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
.
|
|
|
|
├── plugins
|
|
|
|
│ ├── EmailPlugin
|
|
|
|
│ │ ├── settings
|
|
|
|
│ │ │ └── EmailSettings.vue
|
|
|
|
```
|
|
|
|
|
|
|
|
A Settings component must specify the following data in its default export object in order for it to automatically show up on the application's settings:
|
|
|
|
|
|
|
|
* `settingsMenuItem`
|
|
|
|
|
|
|
|
Example code:
|
|
|
|
|
|
|
|
```javascript
|
|
|
|
export default {
|
|
|
|
name: 'EmailSettingsPage', // must match the filename
|
|
|
|
settingsMenuItem: {
|
|
|
|
label: 'E-mail',
|
|
|
|
icon: 'email'
|
|
|
|
},
|
|
|
|
// ... other VueJS code
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
You may omit these data points if you don't want to page to show up in the application's settings menu. That might be desirable if it's a child of another settings page, for example. |
|
|
|
\ No newline at end of file |