123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- const state = {
- currencies: {
- default: [],
- values: this.default
- },
- loadingCurrencies: {
- default: false,
- value: true
- }
- }
- const getters = {
- /**
- *
- * @param {*} state
- */
- currencies(state) {
- return state.currencies.values
- },
- /**
- *
- * @param {*} state
- */
- loadingCurrencies(state) {
- return state.loadingCurrencies.value
- }
- }
- const mutations = {
- /**
- *
- * @param {*} state
- * @param {*} payload
- */
- setCurrencies(state, payload) {
- state.currencies.values = [...payload]
- },
- /**
- *
- * @param {*} state
- * @param {*} payload
- */
- setLoadingCurrencies(state, payload) {
- state.loadingCurrencies.value = !!payload
- }
- }
- const actions = {
- /**
- *
- * @param {*} param0
- * @param {*} payload
- */
- initCurrencies({ commit }, payload) {
- commit('setCurrencies', payload)
- commit('setLoadingCurrencies', false)
- },
- /**
- *
- * @param {*} param0
- */
- setCurrencies({ commit }, payload) {
- commit('setCurrencies', payload)
- }
- }
- export default {
- state,
- getters,
- mutations,
- actions
- }
|