这篇文章主要介绍了关于vue使用element实现导航的分析,有着一定的参考价值,现在分享给大家,有需要的朋友可以参考一下
<template> <p> <el-header> <el-menu> <el-menu-item>帮助</el-menu-item> <el-menu-item>中心概括</el-menu-item> <el-menu-item>飞鹰学苑</el-menu-item> <el-menu-item>策略对比</el-menu-item> <el-menu-item>策略回测</el-menu-item> <el-menu-item>组合配置</el-menu-item> </el-menu> <p></p> </el-header> <el-main> <router-view></router-view> </el-main> </p> </template><script> export default { data() { return { activeIndex: "1" }; } }; </script>
vue中使用element实现导航需要注意三个方面
在el-menu中添加 router
更改 :default-active="$route.path"
在el-menu-item中的index属性直接书写的路由
以上就是本文的全部内容,希望对大家的学习有所帮助,更多相关内容请关注PHP中文网!
相关推荐:
以上就是vue使用element实现导航的分析的详细内容,更多请关注php中文网其它相关文章!
Copyright 2014-2024 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号