PHP Classes

File: src/store/modules/settings.js

Recommend this page to a friend!
  Classes of Maniruzzaman Akash   WP Vue Kit Plugin   src/store/modules/settings.js   Download  
File: src/store/modules/settings.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: WP Vue Kit Plugin
Vue.js plugin to build WordPress user interfaces
Author: By
Last change:
Date: 1 year ago
Size: 1,056 bytes
 

Contents

Class file image Download
/** * External dependencies. */ // import axios from 'axios'; // initial state const state = () => ({ settings: null, isSaving: false, }) // getters const getters = { settings: state => state.settings, isSaving: state => state.isSaving, }; // actions const actions = { async storeSettings({ commit }, settings) { commit('setSettingsSaving', true); // @todo: Test checking with Live URL. // await axios.post(`https://example.com`, settings) // .then(res => { // commit('storeSettings', res.data); // commit('setSettingsSaving', false); // }).catch(err => { // console.log('error', err); // commit('setSettingsSaving', false); // }); commit('storeSettings', settings); commit('setSettingsSaving', false); }, } // mutations const mutations = { storeSettings: (state, settings) => { state.settings = settings; }, setSettingsSaving: (state, isSaving) => { state.isSaving = isSaving; }, } export default { state, getters, actions, mutations }