<template>
  <div>sss</div>
</template>

<script lang="ts">
import { defineComponent, computed, reactive, ref, toRefs, unref, onMounted, onUpdated, onUnmounted, provide, inject } from 'vue';
import { initData } from '@/common/methods';
// 1.头部菜单栏
const useMenu = () => {
    interface headerMenu {
        name: string;
        path: string;
        icon?: string;
    }
    const selectedKeys = ref<string[]>(['/login']);
    const menu: headerMenu[] = reactive([
        { path: '/login', name: '您好请登录' },
        { path: '/logon', name: '免费注册' },
        { path: '/', name: '商城' },
        { path: '/order', name: '我的订单' },
        { path: '/pack', name: '我的包裹' },
        { path: '/myGoods', name: '我的商品' },
        { path: '/news', name: '消息中心' },
    ]);
    return {
        selectedKeys,
        menu,
    };
};
export default defineComponent({
    name: 'test',
    components: {},
    setup() {
        // beforeCreate -> 使用 setup()
        // created -> 使用 setup()
        // beforeMount -> onBeforeMount
        // mounted -> onMounted
        // beforeUpdate -> onBeforeUpdate
        // updated -> onUpdated
        // beforeDestroy -> onBeforeUnmount
        // destroyed -> onUnmounted
        // errorCaptured -> onErrorCaptured

        initData(() => {
            // 加载数据在这里
        });
        onMounted((): void => {});
        onUpdated((): void => {});
        onUnmounted((): void => {});
        return {
            ...useMenu(),
        };
    },
});
</script>

<style lang="less"></style>;
