You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
650 B

import html from "html";
import Icon from "../components/icon/index.js";
import { useAppStore } from "../store/index.js";
import MenuItem from "./menu-item.js";
import router from "../router/index.js";
export default {
components: { Icon, MenuItem },
template: html`<el-menu
:collapse="appStore.isMenuCollapse"
:collapse-transition="false"
:default-active="$route.fullPath"
>
<menu-item v-for="item in menus" v-model="item" />
</el-menu>`,
setup() {
const appStore = useAppStore();
const menus = router.getRoutes().find((o) => o.name === "layout").children;
return {
appStore,
menus,
};
},
};