@covergo/ui-renderer
v0.0.21
Published
CoverGo UI Renderer
Downloads
14
Maintainers
Readme
UI Renderer
Component that takes uiConfig JSON and renders Vue component client side
About Schema
Events:
- We should only invoke methods in events
Directives:
- We support only if,for and editor-helpers directive as of now
- Directives are not nativelly supported in React and others so we have to avoid using directives for complex cases that's why we have limited directives we can use
Localization:
- We will localize configs backend side via string interplations (syntax not know now)
- We also have an option to introduce the whole new config if trsanslation is not enough - this allows us to change everything per language
Slots:
- We don't need traditional slots for UI composition - avoid it
- We might need some mechanics for scoped slots - maybe just attributes as it's vue specific?
UI tree:
- Every UI tree has to have only one root component
- Every UI tree node is an object
- We never use keyword "this" to point to data in UI tree
Methods:
- Methods have to be in ES5 syntax so that we support all browsers or we have to figure out some transpilation but that seems complicated
Typed value:
- In some scenarios we need to pass value (e.g. args, props, attributes...)
- We have a special object to handle type properly
{
number: 10,
string: "hello world",
boolean: true,
js: "this.isLoading ? 'Loading...' : ''", can be js expressions as string or Object, Array
}