index.js 1017 Bytes
Newer Older
wanli's avatar
wanli committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
import './index.less'
import RightContent from './RightContent'
import { Icon, Spin } from "ant-design-vue";
import { mapGetters } from "vuex";
const GlobalHeader = {
    props:['theme','layout'],
    computed: {
        ...mapGetters({
            spinning: "global/getBasicLayoutSpinning",
            collapsed: "global/getChangeLayoutCollapsed"
        }),
    },
    methods: {
        onCollapsed() {
            this.$store.commit('global/UpdateChangeLayoutCollapsed', !this.collapsed)
        },
    },
    render() {
        const { spinning, collapsed, onCollapsed, theme,layout } = this
wanli's avatar
wanli committed
20

wanli's avatar
wanli committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34
        return (
            <div class="header-index">
                <Icon
                    class="trigger"
                    type={collapsed ? 'menu-unfold' : 'menu-fold'}
                    onClick={onCollapsed}
                />
                <Spin spinning={spinning}></Spin>
                <RightContent theme={theme} layout={layout}/>
            </div>
        )
    }
}
export default GlobalHeader