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
appGlobal App 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
$appUtil= app.meta.util
$ctxUtil= ctx.meta.util

Page Component

NameDescription
$paramsTyped params parameters
$queryTyped query parameters

Child Component

NameDescription
$propsprops
$emitemit
$slotsslots
$attrsattrs

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
$apiApi object provided by module home-base
$scopeBaseScope object provided by module home-base
$classGlobal style object provided by module home-base
$piniaPinia object provided by module a-pinia
$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

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

Released under the MIT License.