From c405d2615299e8b3392c9cf253021472f8680932 Mon Sep 17 00:00:00 2001 From: Vladislav Date: Tue, 3 Mar 2020 01:52:40 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BE=D1=88=D0=B8=D0=B1=D0=BE=D0=BA?= =?UTF-8?q?,=20=D1=80=D0=B5=D1=84=D0=B0=D0=BA=D1=82=D0=BE=D1=80=D0=B8?= =?UTF-8?q?=D0=BD=D0=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/index.js | 4 ++-- src/store/vuetify-drf-forms.js | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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) => {