Compare commits

...

1 Commits

Author SHA1 Message Date
Pouya
86d3836389 useAssets has been deprecated in 16.0
useAssets was introduced in 15.0 but removed in 16.0 in 8603d13d19 

Now there is an easier way to do it
2023-06-27 11:02:29 +02:00

View File

@@ -307,12 +307,18 @@ provides a few helper functions, located in :file:`@web/core/assets`.
- a list of urls of css files
.. js:function:: useAssets(assets)
For the `widget` component and anything drived from it (most odoo components are)
lazy loading css or js libraries is as easy as adding `cssLibs` and `jsLibs` directly
in the component:
.. code-block:: javascript
export class WidgetStudio extends Widget {
jsLibs: ["/web/static/lib/stacktracejs/stacktrace.js"]
// ...
};
:param Object assets: a description of various assets that should be loaded
This hook is useful when components need to load some assets in their
`onWillStart` method. It internally calls `loadAssets`.
.. _frontend/assets/ir_asset: