mirror of
https://github.com/odoo/owl.git
synced 2025-10-06 19:59:41 +07:00
update examples doc
This commit is contained in:
+35
-13
@@ -1,24 +1,46 @@
|
|||||||
# Examples
|
# Examples
|
||||||
|
|
||||||
To play with the examples:
|
This project features three example to illustrate how to work with the web-core framework:
|
||||||
|
|
||||||
|
- _benchmarks_ is a small application to test large number of widgets,
|
||||||
|
- _todoapp_ is the classical todo application (from the todomvc project),
|
||||||
|
- _web_ is a rethinking of how the odoo web client could be implemented.
|
||||||
|
|
||||||
|
## Benchmarks
|
||||||
|
|
||||||
|
This example is just a playground to experiment/showcase some features of the framework, with large number of widgets.
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run example:build # make a build in dist/app/
|
npm run example:benchmarks:build # make a build in dist/examples/
|
||||||
npm run example:dev # make a build in dist/app/, and make a live server to access it
|
npm run example:benchmarks:dev # make a build in dist/examples/, and make a live server to access it
|
||||||
```
|
```
|
||||||
|
|
||||||
The _example_:dev\_ task will build the app (without minification), then start a live-server with hot-reloading, and watch the file system to make sure
|
The benchmarks application generates a large number of demo messages, and display them in a list, with a few buttons that can
|
||||||
that assets are properly rebuilt if necessary, and then reloaded.
|
be used to alter the number of visible widgets.
|
||||||
|
|
||||||
|
Note that each message is itself a widget, with a sub widget. This
|
||||||
|
example could be made faster (by not using subwidgets), but the point is to observe/measure the overhead of the Component class.
|
||||||
|
|
||||||
|
## Todo App
|
||||||
|
|
||||||
|
The Todo App is the classical todo application from _http://todomvc.com/_. It is a good mini application with non trivial data structures and interface updates.
|
||||||
|
|
||||||
|
```
|
||||||
|
npm run example:todoapp:build # make a build in dist/examples/
|
||||||
|
npm run example:todoapp:dev # make a build in dist/examples/, and make a live server to access it
|
||||||
|
```
|
||||||
|
|
||||||
|
It is implemented with the Store class (as in redux/vuex).
|
||||||
|
|
||||||
## Web Client Example
|
## Web Client Example
|
||||||
|
|
||||||
To test and play with the component class, there is a demo application located
|
The _web_ example,located in the _examples/web/_ folder is a rethink of what the
|
||||||
in the _examples/web/_ folder. It is a rethink of what the web client could look like
|
web client could look like if it is ever rebuilt from scratch. It is currently an experiment. But obviously, we hope someday to be able to use this work and
|
||||||
if it is ever rebuilt from scratch. It is currently an experiment. But
|
actually rewrite completely the odoo web client.
|
||||||
obviously, we hope someday to be able to use this work and actually rewrite
|
|
||||||
completely the odoo web client.
|
|
||||||
|
|
||||||
## Demo
|
```
|
||||||
|
npm run example:web:build # make a build in dist/examples/
|
||||||
|
npm run example:web:dev # make a build in dist/examples/, and make a live server to access it
|
||||||
|
```
|
||||||
|
|
||||||
This example is just a playground to experiment/showcase some features of
|
Note that it is currently written in typescript.
|
||||||
the framework.
|
|
||||||
|
|||||||
Reference in New Issue
Block a user