mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
[REF] component: small improvement
and run prettier
This commit is contained in:
+18
-19
@@ -20,29 +20,28 @@ create a test environment with mock services.
|
||||
|
||||
For example:
|
||||
|
||||
|
||||
```js
|
||||
async function myEnv() {
|
||||
const templates = await loadTemplates();
|
||||
const qweb = new QWeb({templates});
|
||||
const session = getSession();
|
||||
const templates = await loadTemplates();
|
||||
const qweb = new QWeb({ templates });
|
||||
const session = getSession();
|
||||
|
||||
return {
|
||||
_t: myTranslateFunction,
|
||||
session: session,
|
||||
qweb: qweb,
|
||||
services: {
|
||||
localStorage: localStorage,
|
||||
rpc: rpc,
|
||||
},
|
||||
debug: false,
|
||||
inMobileMode: true,
|
||||
};
|
||||
return {
|
||||
_t: myTranslateFunction,
|
||||
session: session,
|
||||
qweb: qweb,
|
||||
services: {
|
||||
localStorage: localStorage,
|
||||
rpc: rpc
|
||||
},
|
||||
debug: false,
|
||||
inMobileMode: true
|
||||
};
|
||||
}
|
||||
|
||||
async function start() {
|
||||
owl.config.env = await myEnv();
|
||||
const app = new App();
|
||||
await app.mount(document.body);
|
||||
owl.config.env = await myEnv();
|
||||
const app = new App();
|
||||
await app.mount(document.body);
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
+2
-2
@@ -1,6 +1,7 @@
|
||||
# 🦉 OWL Documentation 🦉
|
||||
|
||||
## Reference
|
||||
|
||||
- [Animations](reference/animations.md)
|
||||
- [Component](reference/component.md)
|
||||
- [Configuration](reference/config.md)
|
||||
@@ -43,7 +44,7 @@ and `EventBus` is exported as `owl.core.EventBus`):
|
||||
|
||||
```
|
||||
Component misc
|
||||
Context AsyncRoot
|
||||
Context AsyncRoot
|
||||
QWeb router
|
||||
Store Link
|
||||
useState RouteComponent
|
||||
@@ -70,4 +71,3 @@ hooks loadJS
|
||||
```
|
||||
|
||||
Note that for convenience, the `useState` hook is also exported at the root of the `owl` object.
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 🦉 Config 🦉
|
||||
|
||||
The Owl framework is designed to work in many situations. However, it is
|
||||
sometimes necessary to customize some behaviour. This is done by using the
|
||||
The Owl framework is designed to work in many situations. However, it is
|
||||
sometimes necessary to customize some behaviour. This is done by using the
|
||||
global `config` object. It currently has two keys:
|
||||
|
||||
- [`mode`](#mode),
|
||||
|
||||
@@ -15,4 +15,3 @@ Note: some additional information can be found here:
|
||||
|
||||
- [What should go into an environment?](../learning/environment.md)
|
||||
- [Customizing an environment](config.md#env)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user