Skip to content

Model

Modules can individually provide their own Models

Create Model

TIP

Context Menu - [Module Path]: Vona Create/Model

Use Model

The Model of the module can be obtained through the Scope instance

For example, we use the Model menu provided by thie module home-base inside the current module:

typescript
class ControllerMenu {
  async retrieveMenus() {
    const menus = await this.scope.model.menu.select();
  }
}

Use Model cross-module

For example, we use the Model menu provided by thie module home-base inside the module home-index:

typescript
class ControllerHome {
  async index() {
    const menus = await this.$scope.homeBase.model.menu.select();
  }
}

Released under the MIT License.