Vuex

Integrate vuex with Odoo frontend.

12.0

https://hub.konvergo.app/web/image/product.template/1465/image_1920?unique=1f304e3
  • Odoo Version

Description

Vuex

This module integrates Vuex with the frontend assets of Odoo.

Usage Example

This example requires that you master of the following topics:

  • Creating a Vuejs application with Vuex
  • Creating a Odoo javascript extension

Creating a Store

Add a file app.js which defines your Vue application.

require("web.dom_ready");

if (!$("#my_app_node").length) {
  return $.Deferred().reject("DOM doesn't contain '#my_app_node'");
}

const store = require("vuex.store");
const app = new Vue({store}).$mount('#app');

Inside other javascript files, you may register your vuex modules:

const store = require("vuex.store");
store.registerModule(
    "myModule",
    {
        namespaced: true,
        state: {
            ...
        },
        actions: {
            ...
        },
        mutations: {
            ...
        },
    }
)

Contributors

More information


License
Technical Name
Log In to view
Version
12.0