transition
Former-commit-id: 02bd7f913030974f8fea14eca765da453cad40f1 [formerly 02bd7f913030974f8fea14eca765da453cad40f1 [formerly 02bd7f913030974f8fea14eca765da453cad40f1 [formerly 02bd7f913030974f8fea14eca765da453cad40f1 [formerly c80358c9fd4064bdcbb3e8208cdae8960ad29c76 [formerly 339084b596728ca59169ccee025cd5cfb04cc0ea]]]]] Former-commit-id: 0eca34a7cefeac571a42b089b7b606bb0b58321e Former-commit-id: 66da672644dbfbe7ced81383b12a48db14eef43e Former-commit-id: 6580885c5fc24b70ab60017af72f33a9a17a7816 [formerly e217ea71e67a326b82c2dead714fd845af6451d5] Former-commit-id: c8f62875e94b755e14caff6e1f43fada83b5cadf Former-commit-id: 54e5871a85ecbb0e8e23c9359fab455f4d096457 Former-commit-id: 4e15d8fa611c28e7750c974cfd95e43ef6031f7a Former-commit-id: ab1da431925c17c7ff42f73d54897e72a98aa092 Former-commit-id: 6f8297b77f9bf5d960a74cbc6ac787e58241b42f
This commit is contained in:
@@ -10,7 +10,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { mapState, mapMutations } from 'vuex'
|
import { mapState, mapActions } from 'vuex'
|
||||||
export default {
|
export default {
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('d2admin/transition', [
|
...mapState('d2admin/transition', [
|
||||||
@@ -18,7 +18,7 @@ export default {
|
|||||||
])
|
])
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapMutations('d2admin/transition', [
|
...mapActions('d2admin/transition', [
|
||||||
'set'
|
'set'
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export default {
|
|||||||
// DB -> store 加载主题
|
// DB -> store 加载主题
|
||||||
await dispatch('d2admin/theme/load', null, { root: true })
|
await dispatch('d2admin/theme/load', null, { root: true })
|
||||||
// DB -> store 加载页面过渡效果设置
|
// DB -> store 加载页面过渡效果设置
|
||||||
commit('d2admin/transition/load', null, { root: true })
|
await dispatch('d2admin/transition/load', null, { root: true })
|
||||||
// DB -> store 持久化数据加载上次退出时的多页列表
|
// DB -> store 持久化数据加载上次退出时的多页列表
|
||||||
commit('d2admin/page/openedLoad', null, { root: true })
|
commit('d2admin/page/openedLoad', null, { root: true })
|
||||||
// DB -> store 持久化数据加载侧边栏折叠状态
|
// DB -> store 持久化数据加载侧边栏折叠状态
|
||||||
|
|||||||
@@ -7,34 +7,42 @@ export default {
|
|||||||
// 是否开启页面过度动画
|
// 是否开启页面过度动画
|
||||||
active: setting.transition.active
|
active: setting.transition.active
|
||||||
},
|
},
|
||||||
mutations: {
|
actions: {
|
||||||
/**
|
/**
|
||||||
* @description 设置开启状态
|
* @description 设置开启状态
|
||||||
* @param {Object} state vuex state
|
* @param {Object} state vuex state
|
||||||
* @param {Boolean} active 新的状态
|
* @param {Boolean} active 新的状态
|
||||||
*/
|
*/
|
||||||
set (state, active) {
|
set ({ state, dispatch }, active) {
|
||||||
// store 赋值
|
return new Promise(async resolve => {
|
||||||
state.active = active
|
// store 赋值
|
||||||
// 持久化
|
state.active = active
|
||||||
this.dispatch('d2admin/db/set', {
|
// 持久化
|
||||||
dbName: 'sys',
|
await dispatch('d2admin/db/set', {
|
||||||
path: 'transition.active',
|
dbName: 'sys',
|
||||||
value: state.active,
|
path: 'transition.active',
|
||||||
user: true
|
value: state.active,
|
||||||
|
user: true
|
||||||
|
}, { root: true })
|
||||||
|
// end
|
||||||
|
resolve()
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 从数据库读取页面过渡动画设置
|
* 从数据库读取页面过渡动画设置
|
||||||
* @param {Object} state vuex state
|
* @param {Object} state vuex state
|
||||||
*/
|
*/
|
||||||
async load (state) {
|
load ({ state, dispatch }) {
|
||||||
// store 赋值
|
return new Promise(async resolve => {
|
||||||
state.active = await this.dispatch('d2admin/db/get', {
|
// store 赋值
|
||||||
dbName: 'sys',
|
state.active = await dispatch('d2admin/db/get', {
|
||||||
path: 'transition.active',
|
dbName: 'sys',
|
||||||
defaultValue: setting.transition.active,
|
path: 'transition.active',
|
||||||
user: true
|
defaultValue: setting.transition.active,
|
||||||
|
user: true
|
||||||
|
}, { root: true })
|
||||||
|
// end
|
||||||
|
resolve()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user