index.vue 1.07 KB
Newer Older
水落(YangLei)'s avatar
水落(YangLei) committed
1
<template>
2 3
    <my-card class="tw-flex">
        <a-menu style="flex: 0 0 100px" v-model="selectKeys">
shuiluo's avatar
shuiluo committed
4 5 6 7
            <a-menu-item key="UserInfo">{{ $t('profile') }}</a-menu-item>
            <a-menu-item key="ModifyPassword">{{ $t('user.modifyPassword') }}</a-menu-item>
            <a-menu-item key="MessageCenter">{{ $t('tabNotice') }}</a-menu-item>
            <a-menu-item key="ToDo">{{ $t('tabTodo') }}</a-menu-item>
8 9 10 11 12
        </a-menu>
        <div class="tw-flex-1 tw-ml-6">
            <component :is="currentCom" />
        </div>
    </my-card>
水落(YangLei)'s avatar
水落(YangLei) committed
13
</template>
14 15 16 17

<script>
import UserInfo from './components/info.vue';
import MessageCenter from './components/message.vue';
shuiluo's avatar
shuiluo committed
18
import ToDo from './components/page_todo.vue';
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
import ModifyPassword from './components/modify_password.vue';

const components = {
    UserInfo,
    ToDo,
    MessageCenter,
    ModifyPassword,
};

export default {
    data() {
        return {
            selectKeys: ['UserInfo'],
        };
    },
    computed: {
        currentCom() {
            return components[this.selectKeys[0]];
        },
    },
};
</script>