Skip to content

BeanBase

BeanBase is the base class for all beans. By inheriting from BeanBase, we can easily access commonly used tools and capabilities when writing code.

BeanBase itself provides some built-in members and allows other modules to inject extended members through the monkey mechanism.

Why is Zova's IOC container code more concise?

The reason is to prioritize the use of the dependency lookup strategy, resulting in fewer decorator functions and fewer type annotations. Injecting system capability objects into BeanBase is one of the mechanisms for implementing dependency lookup strategies.

Built-in Members

NameDescription
sysSys object
appApp object
ctxThe Context object which the current bean instance belongs to
beanThe bean container which the current bean instance belongs to
scopeThe Scope object of the module which the current bean instance belongs to
$elThe dom element of the Vue component which the current bean instance belongs to
$eventGlobal event object
$ssrSSR object
$useMetaMeta data for SEO

Page

NameDescription
$paramsTyped params parameters
$queryTyped query parameters

Component

NameDescription
$propsprops

Extended Members

When a project is created, there will be some modules present in the project, providing us with basic capabilities for further development.

NameDescription
$fetchFetch object provided by module a-fetch
$scopeBaseScope object provided by module home-base
$cssBaseGlobal style object provided by module home-base
$queryClientQueryClient object provided by module a-model
$routerRouter object provided by module a-router
$styleStyle method provided by module a-style
$themeTheme object provided by module a-style
$tokenToken object provided by module a-style

Zova can be used with any UI library and comes with built-in project templates for several UI libraries, making it easy to use out of the box. Different UI libraries will also inject objects into the BeanBase base class according to their own needs.

名称说明
$qProvided by module quasar-adapter of Quasar
$vuetifyProvided by module vuetify-adapter of Vuetify

BeanBaseSimple

BeanBase inherits from BeanBaseSimple

Built-in Members

NameDescription
$beanFullNameBean Identifier
$beanOptionsBean Options
$onionNameOnion Name
$onionOptionsOnion Options

Released under the MIT License.