Add a static JSON config
The path
should not contain the .json
suffix.
Build a behavior outside of a definition environment
The method do not need a definition environment, so the global object pollution is avoided.
Build a component outside of a definition environment
The method do not need a definition environment, so the global object pollution is avoided.
path
should be the component path (without ".js" extension).
Get the underlying component space
Get a static JSON config
The path
should not contain the .json
suffix.
Create a component definition environment
During the sync execution of cb
, Component
and Behavior
global vars will be available.
globalObject
should be the JavaScript global object, a.k.a. window
in DOM.
Some global variables, a.k.a Component
Behavior
Page
,
will be written into globalObject
.
path
should be the component path (without ".js" extension).
Import another component space as a plugin (must be in the same environment)
Components from the imported codeSpace
can be used with URLs.
If domainAlias
is provided, the URL format is plugin://DOMAIN_ALIAS/COMPONENT_SPACE_EXPORT_ALIAS
.
If privateImport
is enabled, another URL format is plugin-private://DOMAIN/COMPONENT_IS
.
Optional
domainAlias: stringAdd a behavior for all components
Must be called before any component registration so that the component will use this behavior.
Set to null
to disable this behavior.
Define a trait behavior
A component space with mini-program code manager