Update example for commandsModule
This commit is contained in:
parent
209d575092
commit
05e8c803c9
@ -11,5 +11,27 @@ export default {
|
|||||||
getSopClassHandler() {},
|
getSopClassHandler() {},
|
||||||
getPanelModule() {},
|
getPanelModule() {},
|
||||||
getToolbarModule() {},
|
getToolbarModule() {},
|
||||||
getCommandsModule() {},
|
getCommandsModule(/* store */) {
|
||||||
|
return commandsModule;
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
const commandsModule = {
|
||||||
|
actions: {
|
||||||
|
// Store Contexts + Options
|
||||||
|
exampleAction: ({ viewports, param1 }) => {
|
||||||
|
console.log(`There are ${viewports.length} viewports`);
|
||||||
|
console.log(`param1's value is: ${param1}`);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
definitions: {
|
||||||
|
exampleActionDef: {
|
||||||
|
commandFn: this.actions.exampleAction,
|
||||||
|
storeContexts: ['viewports'],
|
||||||
|
options: { param1: 'hello world' },
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user