import { mapMutations } from 'vuex' export const MixinTop = { data: function () { return { TopConfig: {} } }, methods: { ...mapMutations({ updateLayoutConfig: 'updateLayoutConfig', clearLayoutConfig: 'clearLayoutConfig' }), upTopConfig () { ;(this as any).updateLayoutConfig((this as any).TopConfig) } }, beforeRouteEnter (to: any, form: any, next: any) { next((vm: any) => { console.log(vm.TopConfig.actionRightCallback) vm.upTopConfig() }) }, beforeRouteUpdate (to: any, form: any, next: any) { // 暂无场景 console.log('beforeRouteUpdate') next() }, beforeRouteLeave (to: any, form: any, next: any) { ;(this as any).clearLayoutConfig() next() } }