PHP Classes

File: resources/js/store/modules/FlashMessage.js

Recommend this page to a friend!
  Classes of Edward Paul   Flexible PHP Coupon System   resources/js/store/modules/FlashMessage.js   Download  
File: resources/js/store/modules/FlashMessage.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Flexible PHP Coupon System
E-commerce system that supports discount coupons
Author: By
Last change:
Date: 3 years ago
Size: 572 bytes
 

Contents

Class file image Download
import coupon from "./Coupon"; const state = { message: null }; const actions = { flashMessage({commit}, message){ commit('setMessage', message); setTimeout(() => { commit('clearMessage') }, 3000) } }; const getters = { message : state => { return state.message; } }; const mutations = { setMessage(state, message){ state.message = message }, clearMessage(state, message){ state.message = null } }; export default { state, getters, mutations, actions }