Iniziato il SignUp

This commit is contained in:
paolo
2018-10-13 19:14:58 +02:00
parent a2673c0502
commit 43f2484e54
53 changed files with 3072 additions and 518 deletions

View File

@@ -3,6 +3,7 @@ import Vuex from 'vuex'
import example from './module-example/index'
import glob from './modules/glob';
import types from './mutation-types'
Vue.use(Vuex);

View File

@@ -5,76 +5,53 @@ Vue.use(Vuex);
import * as types from '../mutation-types'
export const state = {
conta: 0,
deferredPrompt: null,
layoutNeeded: true,
isLoginPage: false,
layoutNeeded: true,
mobileMode: false,
menuCollapse: true,
posts: [{title:'titolo 1'}, {title:'titolo 2'}],
posts: [],
};
export const mutations = {
setValue (state) {
state.conta = value
},
setDefprompt (state, value) {
state.deferredPrompt = value
},
setdefprompt (state, value) {
state.deferredPrompt = value
},
setLayoutNeeded (state, value) {
state.layoutNeeded = value
},
setIsLoginPage (state, value) {
state.isLoginPage = value
},
setMobileMode (state, value) {
state.mobileMode = value
},
setMenuCollapse (state, value) {
state.menuCollapse = value
},
setPosts (state, posts) {
state.posts = posts
}
};
export const getters = {
getConta () {
return state.conta
},
getDeferredPrompt() {
return state.deferredPrompt
},
getLayoutNeeded () {
return state.layoutNeeded
},
getIsLoginPage () {
return state.isLoginPage
},
getMobileMode () {
return state.mobileMode
},
getMenuCollapse () {
return state.menuCollapse
},
getPosts () {
return state.posts
},
//evenOrsOdd: state => state.count % 2 === 0 ? 'even' : 'odd'
getConta: state => state.conta,
getDeferredPrompt: state => state.deferredPrompt,
getIsLoginPage: state => state.isLoginPage,
getLayoutNeeded: state => state.layoutNeeded,
getMobileMode: state => state.mobileMode,
getMenuCollapse: state => state.menuCollapse,
getPosts: state => state.posts,
};
export const mutations = {
[types.SET_VALUE]: (state, payload) => { state.conta = payload; },
[types.SET_DEFFERED_PROMPT]: (state, payload) => { state.deferredPrompt = payload; },
[types.SET_LOGIN_PAGE]: (state, payload) => { state.isLoginPage = payload; },
[types.SET_LAYOUT_NEEDED]: (state, payload) => { state.layoutNeeded = payload; },
[types.SET_MOBILE_MODE]: (state, payload) => { state.mobileMode = payload; },
[types.SET_MENU_COLLAPSED]: (state, payload) => { state.menuCollapse = payload; },
[types.SET_POSTS]: (state, payload) => { state.posts = payload; },
};
export const actions = {
[types.SET_VALUE]: ({commit}, payload) => { commit(types.SET_VALUE, payload) },
[types.SET_DEFFERED_PROMPT]: ({commit}, payload) => { commit(types.SET_DEFFERED_PROMPT, payload) },
[types.SET_LOGIN_PAGE]: ({commit}, payload) => { commit(types.SET_LOGIN_PAGE, payload) },
[types.SET_LAYOUT_NEEDED]: ({commit}, payload) => { commit(types.SET_LAYOUT_NEEDED, payload) },
[types.SET_MOBILE_MODE]: ({commit}, payload) => { commit(types.SET_MOBILE_MODE, payload) },
[types.SET_MENU_COLLAPSED]: ({commit}, payload) => { commit(types.SET_MENU_COLLAPSED, payload) },
[types.SET_POSTS]: ({commit}, payload) => { commit(types.SET_POSTS, payload) },
};
export default {
namespaced: true,
state,
getters,
mutations,
};
actions
}

View File

@@ -1,5 +1,19 @@
export const SET_VALUE = 'SET_VALUE';
export const SET_DEFFERED_PROMPT = 'defprompt';
export const SET_LOGIN_PAGE = 'setloginpage';
export const SET_LAYOUT_NEEDED = 'setlayneeded';
export const SET_MOBILE_MODE = 'setmobilemode';
export const SET_MENU_COLLAPSED = 'setmenucoll';
export const SET_POSTS = 'setposts';
export const SET_FORM_SIGNUP = 'formsignup';
// USER:
export const USER_REC = 'user_rec';
export const USER_USERNAME = 'username';
export const USER_EMAIL = 'email';
export const USER_PASSWORD = 'password';
export const USER_DATEOFBIRTH = 'dateofbirth';