Building in Production -> put to the Server
give an error: Vuex handler functions must not be anonymous. Resolve: npm cache clean --force npm install npm i npm@latest -g
This commit is contained in:
@@ -12,14 +12,11 @@ const state: IGlobalState = {
|
||||
}
|
||||
|
||||
const b = storeBuilder.module<IGlobalState>('GlobalModule', state)
|
||||
const stateGetter = b.state()
|
||||
|
||||
// Getters
|
||||
namespace Getters {
|
||||
|
||||
const conta = b.read(function conta(state): number {
|
||||
return state.conta
|
||||
})
|
||||
const conta = b.read(state => state.conta , 'conta')
|
||||
|
||||
export const getters = {
|
||||
get conta() {
|
||||
@@ -51,6 +48,8 @@ namespace Actions {
|
||||
|
||||
}
|
||||
|
||||
const stateGetter = b.state()
|
||||
|
||||
// Module
|
||||
const GlobalModule = {
|
||||
get state() { return stateGetter()},
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
import Vuex, { Store } from 'vuex'
|
||||
import Vue from 'vue'
|
||||
import {RootState} from '@store'
|
||||
import { getStoreBuilder } from 'vuex-typex'
|
||||
Vue.use(Vuex)
|
||||
|
||||
export const storeBuilder = getStoreBuilder<RootState>()
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
import Api from '@api'
|
||||
import { ISignupOptions, ISigninOptions, IUserState } from 'model'
|
||||
import { ILinkReg, IResult, IIdToken } from 'model/other'
|
||||
@@ -8,8 +7,6 @@ import router from '@router'
|
||||
import { serv_constants } from '../Modules/serv_constants'
|
||||
import { rescodes } from '../Modules/rescodes'
|
||||
|
||||
|
||||
|
||||
const bcrypt = require('bcryptjs')
|
||||
|
||||
|
||||
@@ -34,15 +31,15 @@ const stateGetter = b.state()
|
||||
|
||||
namespace Getters {
|
||||
|
||||
const lang = b.read(function lang(state): string {
|
||||
const lang = b.read(state => {
|
||||
if (state.lang !== '') {
|
||||
return state.lang
|
||||
} else {
|
||||
return process.env.LANG_DEFAULT
|
||||
}
|
||||
})
|
||||
}, 'lang')
|
||||
|
||||
const tok = b.read(function tok(state): string {
|
||||
const tok = b.read(state => {
|
||||
if (state.tokens) {
|
||||
if (typeof state.tokens[0] !== 'undefined') {
|
||||
return state.tokens[0].token
|
||||
@@ -52,7 +49,7 @@ namespace Getters {
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
})
|
||||
}, 'tok')
|
||||
|
||||
export const getters = {
|
||||
get lang() {
|
||||
|
||||
@@ -22,15 +22,3 @@ export { default as Api } from './Api'
|
||||
|
||||
const store: Store<RootState> = getStoreBuilder<RootState>().vuexStore()
|
||||
export default store
|
||||
|
||||
// export function createStore() {
|
||||
// const store: Store<RootState> = storeBuilder.vuexStore({
|
||||
// strict: DebugMode
|
||||
// })
|
||||
//
|
||||
// return store
|
||||
//
|
||||
// }
|
||||
// export default new Vuex.Store<RootState>({
|
||||
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user