mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
doc: update readme to add a minimal hello world
This commit is contained in:
@@ -64,7 +64,23 @@ Note that the test scripts also run the example tests suites.
|
||||
|
||||
# Examples
|
||||
|
||||
There are two examples of how to work with this web framework:
|
||||
Here is a minimal Hello World example:
|
||||
|
||||
- [Demo Application](examples/readme.md#demo)
|
||||
```javascript
|
||||
class HelloWorld extends owl.core.Component {
|
||||
inlineTemplate = `<div>Hello <t t-esc="state.name"/></div>`;
|
||||
}
|
||||
|
||||
const env = {
|
||||
qweb: new owl.core.QWeb()
|
||||
};
|
||||
|
||||
const hello = new HelloWorld(env, { name: "World" });
|
||||
hello.mount(document.body);
|
||||
```
|
||||
|
||||
More interesting examples on how to work with this web framework can be found in the _examples/_ folder:
|
||||
|
||||
- [Todo Application](examples/readme.md#todo-app)
|
||||
- [Web Client](examples/readme.md#web-client-example)
|
||||
- [Benchmarks](examples/readme.md#benchmarks)
|
||||
|
||||
Reference in New Issue
Block a user