当前位置: 首页 > news >正文

wordpress如何安裝seo 工具

wordpress如何安裝,seo 工具,html模板网页,镇江市质监站网址基于vue-element-admin的顶部一级导航栏的调整&#xff0c;因为一级路由过多导致其他元素被挤到第二行&#xff0c;故现在将原来一级路由数组拆分成两个数组&#xff0c;第二个数组以子菜单显示 关键处调整代码 html <el-menu:active-text-color"variables.menuActiv…

        基于vue-element-admin的顶部一级导航栏的调整,因为一级路由过多导致其他元素被挤到第二行,故现在将原来一级路由数组拆分成两个数组,第二个数组以子菜单显示

       关键处调整代码

html

<el-menu:active-text-color="variables.menuActiveText":default-active="activeMenu"mode="horizontal"@select="handleSelect"><div v-for="item in displayedRoutes" :key="item.path" class="nav-item"><app-link :to="resolvePath(item)"><el-menu-item v-if="!item.hidden" :index="item.path"><i:class="item.meta && item.meta.icon ? item.meta.icon : 'el-icon-house'"></i>{{item.meta ? item.meta.title : item.children[0].meta.title}}</el-menu-item></app-link></div><el-submenu v-if="hiddenRoutes.length > 0" index="coll"><template slot="title"><i class="el-icon-more"></i></template><div v-for="item in hiddenRoutes" :key="item.path" class="nav-item"><app-link :to="resolvePath(item)"><el-menu-item v-if="!item.hidden" :index="item.path"><i:class="item.meta && item.meta.icon ? item.meta.icon : 'el-icon-house'"></i>{{item.meta ? item.meta.title : item.children[0].meta.title}}</el-menu-item></app-link></div></el-submenu></el-menu>

js

export default {name: "Topbar",components: {AppLink,},data() {return {activeIndex: "1",logo: titlePng,// avatar: sessionStorage.getItem("avatar"),routes: constantRoutes,};},computed: {...mapGetters(["permission_routes", "async_routes", "avatar"]),activeMenu() {const route = this.$route;const { meta, path } = route;// if set path, the sidebar will highlight the path you setif (meta.activeMenu) {return meta.activeMenu;}// 如果是首页,首页高亮if (path === "/dashboard") {return "/";}// 如果不是首页,高亮一级菜单const activeMenu = "/" + path.split("/")[1];return activeMenu;},variables() {return variables;},sidebar() {return this.$store.state.app.sidebar;},displayedRoutes() {// 这里可以根据需要定义展示的路由项return this.routes.slice(0, 9); // 例如,展示前 9 个路由},hiddenRoutes() {// 返回剩余的路由项const hidden = this.routes.slice(9); // 省略的路由项return hidden.length > 0 ? hidden : []; // 只有在有省略项时返回},},watch: {activeMenu(newVal, oldVal) {this.handleSelect(newVal);},},mounted() {this.initCurrentRoutes();},methods: {// 通过当前路径找到二级菜单对应项,存到store,用来渲染左侧菜单initCurrentRoutes() {this.$router.addRoutes(this.async_routes);this.routes = this.permission_routes; // 动态路由赋值const { path } = this.$route;let route = this.routes.find((item) => item.path === "/" + path.split("/")[1]);// 如果找不到这个路由,说明是首页if (!route) {route = this.routes.find((item) => item.path === "/");}this.$store.commit("permission/SET_CURRENT_ROUTES", route);this.setSidebarHide(route);},// 判断该路由是否只有一个子项或者没有子项,如果是,则在一级菜单添加跳转路由isOnlyOneChild(item) {if (item.children && item.children.length === 1) {return true;}return false;},resolvePath(item) {// 如果是个完成的url直接返回if (isExternal(item.path)) {return item.path;}// 如果是首页,就返回重定向路由if (item.path === "/") {const path = item.redirect;return path;}// 如果有子项,默认跳转第一个子项路由let path = "";/*** item 路由子项* parent 路由父项*/const getDefaultPath = (item, parent) => {// 如果path是个外部链接(不建议),直接返回链接,存在个问题:如果是外部链接点击跳转后当前页内容还是上一个路由内容if (isExternal(item.path)) {path = item.path;return;}// 第一次需要父项路由拼接,所以只是第一个传parentif (parent) {path += parent.path + "/" + item.path;} else {path += "/" + item.path;}// 如果还有子项,继续递归if (item.children) {getDefaultPath(item.children[0]);}};if (item.children) {getDefaultPath(item.children[0], item);return path;}return item.path;},handleSelect(key, keyPath) {// 把选中路由的子路由保存storeconst route = this.routes.find((item) => item.path === key);this.$store.commit("permission/SET_CURRENT_ROUTES", route);this.setSidebarHide(route);},// 设置侧边栏的显示和隐藏setSidebarHide(route) {if (!route.children || route.children.length === 1) {this.$store.dispatch("app/toggleSideBarHide", true);} else {this.$store.dispatch("app/toggleSideBarHide", false);}},async logout() {await this.$store.dispatch("user/logout");this.$router.push(`/login?redirect=${this.$route.fullPath}`);},toggleFullScreen() {// 检查浏览器是否支持全屏 APIif (screenfull.isEnabled) {screenfull.toggle(); // 切换全屏模式} else {console.warn("该浏览器不支持全屏");}},},
};
</script>

       拆分逻辑是如果数组长度超过九个就拆分。如果想要根据不同浏览器窗口大小去拆分显示,需要去监听浏览器的实时宽度,计算整行所有元素的长度总和,如果超出则将超出的路由加入子菜单中显示

http://www.yidumall.com/news/92410.html

相关文章:

  • 做投票链接的网站电商网站订烟平台官网
  • 编程 毕业设计代做网站网络营销代运营外包公司
  • 柳州建设厅官方网站百度舆情
  • 长春美容网站建设百度seo排名优化
  • 网站备案 山东核验点百度网盘下载官网
  • 武汉有几家做蔬菜配送的网站北京网站优化快速排名
  • 化妆品网站方案精准营销包括哪几个方面
  • 南京做网站公司地点百度网站是什么
  • wordpress右侧悬浮长沙靠谱关键词优化公司电话
  • 电子商务网站需要做那些准备工作一键优化清理加速
  • 做网站用什么主机好河南企业网站建设
  • 网站建设项目选题实时军事热点
  • 做网站工资年新多少在广东今日国际军事新闻头条
  • 伯爵手表网站常州网站建设
  • 海外公司网站 国内做备案近期新闻大事
  • 深圳响应式网站开发yandere搜索引擎入口
  • 宁波搭建网站价格如何建立免费公司网站
  • 北京网站建设公司黄页淘宝引流推广怎么做
  • 自助网站开发如何结合搜索检索与seo推广
  • 公司网站备案怎么做今日国内新闻最新消息
  • 网站如何做中英文双语言版本小型项目外包网站
  • 免费模板下载软件免费seo网站推广在线观看
  • 用易语言做网站谷歌搜索入口 镜像
  • 全国网站制作公司排名互联网营销师证书怎么考多少钱
  • 邯郸企业做网站方案企业官网
  • 做网站一定要购买虚拟主机吗公众号软文怎么写
  • 中建名城建设有限公司 网站财经新闻每日财经报道
  • 为什么营销型网站比普通网站建站贵福州外包seo公司
  • 营业范围中网站开发与网页设计什么是软文营销?
  • 重庆做网站及优化报价茶叶营销策划方案