/
Menu and Component (4h)

Menu and Component (4h)

Menu

Register a POS menu

import {HelloWorldContainerConnection} from '../view/helloworld' import ModuleConfigAbstract from "../../ModuleConfigAbstract"; class HelloWorldConfig extends ModuleConfigAbstract{ module = ['helloworld']; menu = { test: { "id": "test", "title": "Test", "path": "/test", "component": HelloWorldContainerConnection, "className": "item-checkout", "sortOrder": 20 } }; } export default (new HelloWorldConfig());
  • Create HelloWorld component in view/helloworld/HelloWorld.js

  • Create view/helloworld/index.js. We need it to connect HelloWorld component to menu

export default () => { return require('./HelloWorld').default; }

Component

HelloWorldContainerConnection is registered inside a menu. Other way, we can register component via layout, rewrite, plugin, event mechanism.

 

Exercise: Add Menu named Location in POS Menu, when click , display information about Location Name, Staff Name

 

Related content

Rewrite Class (4h)
Rewrite Class (4h)
More like this
Layout Mechanism (4h)
Layout Mechanism (4h)
More like this
Plugin Mechanism (4h)
Plugin Mechanism (4h)
More like this
Add New Reducer (4h)
Add New Reducer (4h)
More like this
Create New Module (1h)
Create New Module (1h)
Read with this
Mixin Mechanism (4h)
Mixin Mechanism (4h)
More like this