From 5b89f9960eb8f698cd2b85d2e405b467de1f5546 Mon Sep 17 00:00:00 2001 From: Pan Date: Tue, 9 Oct 2018 18:40:03 +0800 Subject: [PATCH] add viewsTransition --- src/settings.js | 9 +++++++-- src/store/modules/app.js | 10 +++++++++- src/views/layout/components/AppMain.vue | 5 ++++- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/src/settings.js b/src/settings.js index bca72c62..ea5b130b 100644 --- a/src/settings.js +++ b/src/settings.js @@ -1,5 +1,4 @@ export default { - /** * @property {string} en | zh * @description User first visited, default language @@ -16,7 +15,13 @@ export default { * @property {string} hash | history * @description vue-router mode */ - routerMode: 'hash' + routerMode: 'hash', + + /** + * @property {string} fade-transform | fade + * @description Page transition animation + */ + viewsTransition: 'fade-transform' // permission: true, // i18n: true diff --git a/src/store/modules/app.js b/src/store/modules/app.js index 5df6f28e..9f8b2fd4 100644 --- a/src/store/modules/app.js +++ b/src/store/modules/app.js @@ -9,7 +9,8 @@ const app = { }, device: 'desktop', language: Cookies.get('language') || settings.language, - size: Cookies.get('size') || settings.size + size: Cookies.get('size') || settings.size, + viewsTransition: Cookies.get('viewsTransition') || settings.viewsTransition }, mutations: { TOGGLE_SIDEBAR: state => { @@ -36,6 +37,10 @@ const app = { SET_SIZE: (state, size) => { state.size = size Cookies.set('size', size) + }, + SET_VIEWS_TRANSITION: (state, viewsTransition) => { + state.viewsTransition = viewsTransition + Cookies.set('viewsTransition', viewsTransition) } }, actions: { @@ -53,6 +58,9 @@ const app = { }, setSize({ commit }, size) { commit('SET_SIZE', size) + }, + setViewsTransition({ commit }, viewsTransition) { + commit('SET_VIEWS_TRANSITION', viewsTransition) } } } diff --git a/src/views/layout/components/AppMain.vue b/src/views/layout/components/AppMain.vue index b6a3378f..f22f8356 100644 --- a/src/views/layout/components/AppMain.vue +++ b/src/views/layout/components/AppMain.vue @@ -1,6 +1,6 @@