diff --git a/src/index.js b/src/index.js index f7ee6fe..07b83f0 100644 --- a/src/index.js +++ b/src/index.js @@ -1,5 +1,5 @@ import Vuex from 'vuex'; -import vietify_drf_forms_store from './plugins/vuex'; +import vietify_drf_forms_store from './store/vuetify-drf-forms'; import CForm from './components/CForm'; import CField from './components/CField'; @@ -23,7 +23,7 @@ const install = (Vue, options = {}) => { let {store} = options; if (store) { // если передали store - регистрируем в нем свой модуль - store.registerModule(PLUGIN_NAME, vietify_drf_forms_store); + store.registerModule(PLUGIN_NAME, vietify_drf_forms_store, {preserveState: false}); } else { // не передали, для начала проверим, установлен ли Vuex в Vue if (!new Vue({store: {}}).$store) { diff --git a/src/store/vuetify-drf-forms.js b/src/store/vuetify-drf-forms.js index f331444..c528c1e 100644 --- a/src/store/vuetify-drf-forms.js +++ b/src/store/vuetify-drf-forms.js @@ -10,6 +10,7 @@ function checkEndpoint(state, endpoint) { } } +// noinspection JSUnusedGlobalSymbols const mutations = { setRecordField(state, {endpoint, field, value}) { checkEndpoint(state, endpoint); @@ -71,6 +72,7 @@ const mutations = { } }; +// noinspection JSUnusedGlobalSymbols const getters = { getVuetifyField: (state) => ({endpoint, field}) => { let props = {}; @@ -141,6 +143,7 @@ const getters = { } }; +// noinspection JSUnusedGlobalSymbols const actions = { fetchRecordById({commit}, {endpoint, id}) { this.$axios.get(`${endpoint}${id}/`).then((json) => {