I would like to add a button, that pulls up plugin settings for my plugin.
Is there a way to do this?
e.g. plugin code:
this.button.addEventListener('click', () => {
this.plugin.openSettings()
})
I would like to add a button, that pulls up plugin settings for my plugin.
Is there a way to do this?
e.g. plugin code:
this.button.addEventListener('click', () => {
this.plugin.openSettings()
})
Found it:
this.app.setting.open()
this.app.setting.openTabById('bulk-exporter')
For me this solution does not seem to work anymore. Is there any other solution for opening the plugin settings?
For any TypeScript users, setting
is no public property of this.app
but you can access it by type casting to any
.
const setting = (this.app as any).setting;
setting.open();
setting.openTabById('tab-name');
Not a very clean soution, but it works ^^ Why is it not part of the public API?
If openTabById
is not working, you may need to wait for open
.
async function openSettings():Promise<void>
{
const setting = (this.app as any).setting;
await setting.open();
setting.openTabById('tab-name');
}