index.vue 1.02 KB
Newer Older
水落(YangLei)'s avatar
水落(YangLei) committed
1
<template>
2 3 4 5 6 7 8 9 10 11 12
    <my-card class="tw-flex">
        <a-menu style="flex: 0 0 100px" v-model="selectKeys">
            <a-menu-item key="UserInfo">个人信息</a-menu-item>
            <a-menu-item key="ModifyPassword">修改密码</a-menu-item>
            <a-menu-item key="MessageCenter">消息中心</a-menu-item>
            <a-menu-item key="ToDo">代办事宜</a-menu-item>
        </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 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

<script>
import UserInfo from './components/info.vue';
import MessageCenter from './components/message.vue';
import ToDo from './components/todo.vue';
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>