<script setup>
import { demoRoutes } from "../routes.js";
import { useRoute } from 'vue-router'
import {Menu, MenuItem} from '@king-design/vue';
import { ref } from 'vue';

const route = useRoute();
const selectedKey = ref(route.path);

function select(item) {
  console.log('select--', item)
}

</script>

<template>
  <div>
    <Menu type="horizontal" :selectedKey="selectedKey">
      <MenuItem
          v-for="route in demoRoutes"
          :key="route.path"
          :to="route.path"
          @changeSelect="select"
      >
        {{ route.name }}
      </MenuItem>
    </Menu>
    <router-view></router-view>
  </div>
</template>

<style scoped lang="less">

</style>
